hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f744a75595e4626a91d7455b38a818e175130a42 | 2,725 | py | Python | setup_scripts/extract_images.py | NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation | 24ca4432873f145ad33810f40c851ac10bf030fa | [
"MIT"
] | null | null | null | setup_scripts/extract_images.py | NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation | 24ca4432873f145ad33810f40c851ac10bf030fa | [
"MIT"
] | null | null | null | setup_scripts/extract_images.py | NajusAnaxi/UNet-based-for-Brain-Tumor-Segmentation | 24ca4432873f145ad33810f40c851ac10bf030fa | [
"MIT"
] | null | null | null | import h5py
import numpy as np
import matplotlib.image as mpimg
from tqdm import tqdm
import os
def clear_screen():
"""Clears the console screen irrespective of os used"""
import platform
if platform.system() == 'Windows':
os.system('cls')
return
os.system('clear')
de... | 30.965909 | 74 | 0.621651 | import h5py
import numpy as np
import matplotlib.image as mpimg
from tqdm import tqdm
import os
def clear_screen():
import platform
if platform.system() == 'Windows':
os.system('cls')
return
os.system('clear')
def make_folder(target_folder):
if not (os.path.isdir(targ... | true | true |
f744a7e46efd6bb1ea13bf3fd34c07c498142722 | 31,604 | py | Python | tests/functional/test_functional.py | keitheis/bandit | 917551afdf53a7a9b3470b3d3007e77452b6dbe2 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_functional.py | keitheis/bandit | 917551afdf53a7a9b3470b3d3007e77452b6dbe2 | [
"Apache-2.0"
] | null | null | null | tests/functional/test_functional.py | keitheis/bandit | 917551afdf53a7a9b3470b3d3007e77452b6dbe2 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unl... | 39.653701 | 79 | 0.531483 |
import os
import sys
import six
import testtools
from bandit.core import config as b_config
from bandit.core import constants as C
from bandit.core import manager as b_manager
from bandit.core import metrics
from bandit.core import test_set as b_test_set
class FunctionalTests(testtools.TestCase):
... | true | true |
f744a7e47ab5e4651ce55fe5c5e5cbee8fcf7763 | 1,176 | py | Python | netconf/connection/clientConnection.py | rvilalta/OFC2019_SC472 | c0bcbd05bb6c90eb9d8ab5abdc10b04d65a8a5d3 | [
"Apache-2.0"
] | 2 | 2018-11-28T15:03:08.000Z | 2019-02-04T15:19:58.000Z | netconf/connection/clientConnection.py | rvilalta/OFC2019_SC472 | c0bcbd05bb6c90eb9d8ab5abdc10b04d65a8a5d3 | [
"Apache-2.0"
] | null | null | null | netconf/connection/clientConnection.py | rvilalta/OFC2019_SC472 | c0bcbd05bb6c90eb9d8ab5abdc10b04d65a8a5d3 | [
"Apache-2.0"
] | 2 | 2021-09-28T15:31:03.000Z | 2021-11-16T17:53:59.000Z | from lxml import etree
from netconf.client import NetconfSSHSession
# connexion parameters
host = 'localhost'
port = 830
username = "admin"
password = "admin"
# connexion to server
session = NetconfSSHSession(host, port, username, password)
# server capabilities
print("---GET C---")
c = session.capabilities
print(c)... | 26.133333 | 81 | 0.671769 | from lxml import etree
from netconf.client import NetconfSSHSession
host = 'localhost'
port = 830
username = "admin"
password = "admin"
session = NetconfSSHSession(host, port, username, password)
print("---GET C---")
c = session.capabilities
print(c)
print("---GET CONFIG---")
config = session.get_config()
xmlst... | true | true |
f744a805af1d0be6f7dc53a6c3f760638b75cd15 | 4,002 | py | Python | main.py | gokalpates/Text-Editor | a4d46e5a230233b96f534e9c7c424a9a4a732a0b | [
"MIT"
] | 1 | 2021-07-26T19:42:07.000Z | 2021-07-26T19:42:07.000Z | main.py | gokalpates/Text-Editor | a4d46e5a230233b96f534e9c7c424a9a4a732a0b | [
"MIT"
] | null | null | null | main.py | gokalpates/Text-Editor | a4d46e5a230233b96f534e9c7c424a9a4a732a0b | [
"MIT"
] | null | null | null | import tkinter as tk
import tkinter.filedialog as fd
from functools import partial
def openFileFunction():
filepath = fd.askopenfilename(
filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")]
)
if not filepath:
return
with open(filepath, "r") as inputFile:
buttonName = file... | 30.090226 | 77 | 0.62069 | import tkinter as tk
import tkinter.filedialog as fd
from functools import partial
def openFileFunction():
filepath = fd.askopenfilename(
filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")]
)
if not filepath:
return
with open(filepath, "r") as inputFile:
buttonName = file... | true | true |
f744a84c252a67f854ea567adb3942a0dd483b62 | 228 | py | Python | junitparser/__init__.py | markgras/junitparser | e37e75df6f386977770675c9b075cc4aa61cbd02 | [
"Apache-2.0"
] | null | null | null | junitparser/__init__.py | markgras/junitparser | e37e75df6f386977770675c9b075cc4aa61cbd02 | [
"Apache-2.0"
] | null | null | null | junitparser/__init__.py | markgras/junitparser | e37e75df6f386977770675c9b075cc4aa61cbd02 | [
"Apache-2.0"
] | null | null | null | from .junitparser import (
JUnitXmlError,
Attr,
Element,
JUnitXml,
TestSuite,
Property,
Skipped,
Failure,
Error,
TestCase,
Properties,
IntAttr,
FloatAttr,
)
version = "2.4.1"
| 12.666667 | 26 | 0.583333 | from .junitparser import (
JUnitXmlError,
Attr,
Element,
JUnitXml,
TestSuite,
Property,
Skipped,
Failure,
Error,
TestCase,
Properties,
IntAttr,
FloatAttr,
)
version = "2.4.1"
| true | true |
f744a909f1fd99c03322b6d50fc96cfe441258fe | 2,241 | py | Python | NeuralNetworks-python/Perceptron.py | marcelovca90-inatel/EC017 | 61bbf3c93c13a6743b829c0098d5e33340703f1f | [
"MIT"
] | 7 | 2020-04-15T13:10:34.000Z | 2020-09-30T00:10:24.000Z | NeuralNetworks-python/Perceptron.py | marcelovca90-inatel/EC017 | 61bbf3c93c13a6743b829c0098d5e33340703f1f | [
"MIT"
] | 1 | 2020-05-06T23:33:09.000Z | 2020-05-06T23:33:09.000Z | NeuralNetworks-python/Perceptron.py | marcelovca90-inatel/EC017 | 61bbf3c93c13a6743b829c0098d5e33340703f1f | [
"MIT"
] | 2 | 2020-05-06T00:55:06.000Z | 2020-12-19T16:40:54.000Z | import numpy as np
from _data import DataSets
from _math import ActivationFunctions
from _plot import PlotUtils
class Perceptron:
def __init__(self, n, g):
self.n = n # learning rate
self.g = g # activation function
self.plot_data_x = [] # epochs for plotting
self.plot_d... | 29.486842 | 74 | 0.536368 | import numpy as np
from _data import DataSets
from _math import ActivationFunctions
from _plot import PlotUtils
class Perceptron:
def __init__(self, n, g):
self.n = n
self.g = g
self.plot_data_x = []
self.plot_data_y = []
def train(self, x, d):
k = len(x)... | true | true |
f744a96eb73b55afae296380ba0f301302a1d7ae | 4,555 | py | Python | test/test_filepost.py | hbashton/urllib3 | 3d2e632650e2d2d11b4ebd40d136bc40b2eb8cad | [
"MIT"
] | 1 | 2020-02-27T18:13:40.000Z | 2020-02-27T18:13:40.000Z | test/test_filepost.py | hbashton/urllib3 | 3d2e632650e2d2d11b4ebd40d136bc40b2eb8cad | [
"MIT"
] | null | null | null | test/test_filepost.py | hbashton/urllib3 | 3d2e632650e2d2d11b4ebd40d136bc40b2eb8cad | [
"MIT"
] | 1 | 2020-02-27T18:13:32.000Z | 2020-02-27T18:13:32.000Z | import unittest
from urllib3.filepost import encode_multipart_formdata, iter_fields
from urllib3.fields import RequestField
from urllib3.packages.six import b, u
BOUNDARY = '!! test boundary !!'
class TestIterfields(unittest.TestCase):
def test_dict(self):
for fieldname, value in iter_fields(dict(a='b... | 35.866142 | 92 | 0.494402 | import unittest
from urllib3.filepost import encode_multipart_formdata, iter_fields
from urllib3.fields import RequestField
from urllib3.packages.six import b, u
BOUNDARY = '!! test boundary !!'
class TestIterfields(unittest.TestCase):
def test_dict(self):
for fieldname, value in iter_fields(dict(a='b... | true | true |
f744a9737bb0fbf30a4cd46744b6f67ac35afa46 | 1,377 | py | Python | skultrafast/tests/test_quickcontrol.py | Tillsten/skultrafast | 778eaf1539b6d85f21ac53b011472605673ef7e8 | [
"BSD-3-Clause"
] | 10 | 2019-02-17T15:57:51.000Z | 2021-11-15T02:00:33.000Z | skultrafast/tests/test_quickcontrol.py | Tillsten/skultrafast | 778eaf1539b6d85f21ac53b011472605673ef7e8 | [
"BSD-3-Clause"
] | 1 | 2019-01-17T11:56:38.000Z | 2019-07-11T15:30:58.000Z | skultrafast/tests/test_quickcontrol.py | Tillsten/skultrafast | 778eaf1539b6d85f21ac53b011472605673ef7e8 | [
"BSD-3-Clause"
] | 6 | 2018-11-08T14:11:06.000Z | 2021-09-01T14:53:02.000Z | import pytest
import tempfile
import zipfile
import zipfile_deflate64
from pathlib import Path
from skultrafast.quickcontrol import QC1DSpec, QC2DSpec, parse_str, QCFile
from skultrafast.data_io import get_example_path, get_twodim_dataset
def test_parse():
assert (parse_str('-8000.000000') == -8000.0)
assert... | 25.5 | 74 | 0.687001 | import pytest
import tempfile
import zipfile
import zipfile_deflate64
from pathlib import Path
from skultrafast.quickcontrol import QC1DSpec, QC2DSpec, parse_str, QCFile
from skultrafast.data_io import get_example_path, get_twodim_dataset
def test_parse():
assert (parse_str('-8000.000000') == -8000.0)
assert... | true | true |
f744a9f28cf995288249927327051a2701c0a36f | 1,455 | py | Python | scinet/data_loader.py | waitong94/nn_physical_concepts | f8cc03d46431641e7ef2ecbaeb1a1494a95f2550 | [
"Apache-2.0"
] | null | null | null | scinet/data_loader.py | waitong94/nn_physical_concepts | f8cc03d46431641e7ef2ecbaeb1a1494a95f2550 | [
"Apache-2.0"
] | null | null | null | scinet/data_loader.py | waitong94/nn_physical_concepts | f8cc03d46431641e7ef2ecbaeb1a1494a95f2550 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 SciNet (https://github.com/eth-nn-physics/nn_physical_concepts)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 39.324324 | 87 | 0.7189 |
import cPickle
import gzip
import io
import numpy as np
def load(validation_size_p, file_name):
f = gzip.open(io.data_path + file_name + ".plk.gz", 'rb')
data, states, params = cPickle.load(f)
states = np.array(states)
train_val_separation = int(len(data[0]) * (1 - validation_size_p / 10... | true | true |
f744aa68bf6d6d7fcda5f02107c08ea06b2bc863 | 1,756 | py | Python | apps/howto_deploy/python_deploy.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | apps/howto_deploy/python_deploy.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | apps/howto_deploy/python_deploy.py | ravikumarvc/incubator-tvm | 9826947ffce0ed40e9d47a0db2abb033e394279e | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.583333 | 62 | 0.733485 |
import tvm
import numpy as np
def verify(mod, fname):
f = mod.get_function(fname)
N = 10
x = tvm.nd.array(np.arange(N, dtype=np.float32))
y = tvm.nd.array(np.zeros(N, dtype=np.float32))
f(x, y)
np_x = x.asnumpy()
np_y = y.asnumpy()
assert(np.all([xi+1 == yi for xi,... | true | true |
f744aaa293222a803c91ff573b49f503a74e9b57 | 16,187 | py | Python | amuse-interface/interface.py | michelamapelli/PeTar | 395942c5a35f462075fe69027d95d78aeeef0180 | [
"MIT"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | amuse-interface/interface.py | michelamapelli/PeTar | 395942c5a35f462075fe69027d95d78aeeef0180 | [
"MIT"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | amuse-interface/interface.py | michelamapelli/PeTar | 395942c5a35f462075fe69027d95d78aeeef0180 | [
"MIT"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | from amuse.rfi.core import legacy_function, LegacyFunctionSpecification
from amuse.community import (
CodeInterface,
LiteratureReferencesMixIn,
StoppingConditionInterface,
StoppingConditions,
)
from amuse.community.interface.gd import (
GravitationalDynamics,
GravitationalDynamicsInterface,
... | 29.324275 | 111 | 0.542905 | from amuse.rfi.core import legacy_function, LegacyFunctionSpecification
from amuse.community import (
CodeInterface,
LiteratureReferencesMixIn,
StoppingConditionInterface,
StoppingConditions,
)
from amuse.community.interface.gd import (
GravitationalDynamics,
GravitationalDynamicsInterface,
... | true | true |
f744aaae2196ac4081ec652b22d4e5afb8cec81d | 39,257 | py | Python | env/lib/python3.5/site-packages/sklearn/externals/joblib/memory.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/Lib/site-packages/sklearn/externals/joblib/memory.py | uncledragon/CalibrationLibrary | 952abcf471b819b6b6dfa23b6d5dd248155f9dbf | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/Lib/site-packages/sklearn/externals/joblib/memory.py | uncledragon/CalibrationLibrary | 952abcf471b819b6b6dfa23b6d5dd248155f9dbf | [
"MIT"
] | 3 | 2019-06-13T07:10:54.000Z | 2020-09-11T06:01:40.000Z | """
A context object for caching a function's return value each time it
is called with the same input arguments.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import with_statement
import os
import time
im... | 39.335671 | 79 | 0.569911 |
from __future__ import with_statement
import os
import time
import pydoc
import re
import functools
import traceback
import warnings
import inspect
import weakref
from . import hashing
from .func_inspect import get_func_code, get_func_name, filter_args
from .func_inspect import format_call
from .func_inspect im... | true | true |
f744aacaf7a72a29872a35c6e5a0cc8e878a6b68 | 437 | py | Python | src/psc_parse/__init__.py | satamame/psc_parse | 397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31 | [
"MIT"
] | null | null | null | src/psc_parse/__init__.py | satamame/psc_parse | 397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31 | [
"MIT"
] | null | null | null | src/psc_parse/__init__.py | satamame/psc_parse | 397c54f6151dc8f37bbe0d9d1f9adbc2c5b6ff31 | [
"MIT"
] | null | null | null | from .psc_class import PscClass
from .juman_psc import JumanPsc
from .mrph_test import mrph_test_dir
from .mrph_match import MrphMatch, MRPH_MTCH_PTN
from .features import make_features, features_in_lines
from .model import get_dataset, make_model
__all__ = [
'PscClass',
'JumanPsc',
'mrph_test_dir',
'M... | 23 | 54 | 0.734554 | from .psc_class import PscClass
from .juman_psc import JumanPsc
from .mrph_test import mrph_test_dir
from .mrph_match import MrphMatch, MRPH_MTCH_PTN
from .features import make_features, features_in_lines
from .model import get_dataset, make_model
__all__ = [
'PscClass',
'JumanPsc',
'mrph_test_dir',
'M... | true | true |
f744aaf13b090d371919b8923614f10a70d1932d | 11,277 | py | Python | Codes/download.py | Xzonn/FamitsuWeeklySales | 470a39cd5a1dc7334b01a404c5eef5582f35868e | [
"WTFPL"
] | null | null | null | Codes/download.py | Xzonn/FamitsuWeeklySales | 470a39cd5a1dc7334b01a404c5eef5582f35868e | [
"WTFPL"
] | null | null | null | Codes/download.py | Xzonn/FamitsuWeeklySales | 470a39cd5a1dc7334b01a404c5eef5582f35868e | [
"WTFPL"
] | null | null | null | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import datetime
import json
import os
import re
import requests
import time
from bs4 import BeautifulSoup
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'
def try_write(path, text):
paths = path.split("/")
sub_path = ""
for i in paths[:-1]:
... | 36.732899 | 212 | 0.613816 |
import datetime
import json
import os
import re
import requests
import time
from bs4 import BeautifulSoup
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL:@SECLEVEL=1'
def try_write(path, text):
paths = path.split("/")
sub_path = ""
for i in paths[:-1]:
sub_path += f"{i}/"
if not os.path.ex... | true | true |
f744abaa068a889f6d1aa4fe9e5c2b79590ae4f8 | 10,956 | py | Python | renpy/arguments.py | theizrael/renpy-7.4.10-sdk | 312192c87f92eb0ac29be78d26421856f767279e | [
"Apache-2.0"
] | null | null | null | renpy/arguments.py | theizrael/renpy-7.4.10-sdk | 312192c87f92eb0ac29be78d26421856f767279e | [
"Apache-2.0"
] | null | null | null | renpy/arguments.py | theizrael/renpy-7.4.10-sdk | 312192c87f92eb0ac29be78d26421856f767279e | [
"Apache-2.0"
] | null | null | null | # Copyright 2004-2021 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | 34.561514 | 201 | 0.670683 |
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
from renpy.compat import *
import argparse
import os
import renpy
try:
import site
site._renpy_argv_emulation()
except:
pass
commands = { }
display = { }
# Commands that fo... | true | true |
f744ac98f4d0587c815207bc2270b7931fac33c3 | 2,003 | py | Python | bx_django_utils/humanize/time.py | boxine/bx_django_utils | 1864cb062ecb7570954c8142ef6765af25931760 | [
"MIT"
] | 7 | 2021-05-21T08:52:30.000Z | 2022-02-23T09:06:06.000Z | bx_django_utils/humanize/time.py | boxine/bx_django_utils | 1864cb062ecb7570954c8142ef6765af25931760 | [
"MIT"
] | 3 | 2021-06-11T11:27:43.000Z | 2022-02-08T17:30:19.000Z | bx_django_utils/humanize/time.py | boxine/bx_django_utils | 1864cb062ecb7570954c8142ef6765af25931760 | [
"MIT"
] | null | null | null | import datetime
from django.utils.html import avoid_wrapping
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, gettext_lazy('%.1f years')),
(60 * 60 * 24 * 30, gettext_lazy('%.1f months')),
(60 * 60 * 24 * 7, gett... | 29.895522 | 97 | 0.621068 | import datetime
from django.utils.html import avoid_wrapping
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, gettext_lazy('%.1f years')),
(60 * 60 * 24 * 30, gettext_lazy('%.1f months')),
(60 * 60 * 24 * 7, gett... | true | true |
f744acf4d5adb94281cfd2646faa20e6c6f07622 | 3,557 | py | Python | ocr/charSeg.py | manhcuogntin4/handwritting-ocr | aa55c2d46156a10663ad55e2fa4590c3e1333130 | [
"MIT"
] | null | null | null | ocr/charSeg.py | manhcuogntin4/handwritting-ocr | aa55c2d46156a10663ad55e2fa4590c3e1333130 | [
"MIT"
] | null | null | null | ocr/charSeg.py | manhcuogntin4/handwritting-ocr | aa55c2d46156a10663ad55e2fa4590c3e1333130 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from .helpers import *
from .tfhelpers import Graph
import cv2
import math
# Preloading trained model with activation function
# Loading is slow -> prevent multiple loads
print("Loading Segmantation model:")
segCNNGraph = Graph('models/gap-clas/CNN-CG'... | 32.633028 | 80 | 0.513635 |
import numpy as np
import tensorflow as tf
from .helpers import *
from .tfhelpers import Graph
import cv2
import math
print("Loading Segmantation model:")
segCNNGraph = Graph('models/gap-clas/CNN-CG')
segLargeCNNGraph = Graph('models/gap-clas/large/CNN-CG')
segRNNGraph = Graph('models/gap-clas/RNN/Bi-RNN', 'predict... | true | true |
f744ad3b589657fdef83119288c04fef4d4df4c3 | 1,685 | py | Python | src/SALib/test_functions/Sobol_G.py | cmutel/SALib | 32e33c423bcc981d0cfd4339a3e2435d6b945de1 | [
"MIT"
] | 8 | 2017-05-05T08:56:41.000Z | 2020-12-28T15:03:38.000Z | src/SALib/test_functions/Sobol_G.py | cmutel/SALib | 32e33c423bcc981d0cfd4339a3e2435d6b945de1 | [
"MIT"
] | 1 | 2015-04-22T10:04:31.000Z | 2015-04-22T10:04:32.000Z | src/SALib/test_functions/Sobol_G.py | cmutel/SALib | 32e33c423bcc981d0cfd4339a3e2435d6b945de1 | [
"MIT"
] | 1 | 2017-11-05T08:05:23.000Z | 2017-11-05T08:05:23.000Z | from __future__ import division
import numpy as np
# Non-monotonic Sobol G Function (8 parameters)
# First-order indices:
# x1: 0.7165
# x2: 0.1791
# x3: 0.0237
# x4: 0.0072
# x5-x8: 0.0001
def evaluate(values, a=None):
if type(values) != np.ndarray:
raise TypeError("The argument `values` m... | 25.149254 | 81 | 0.57092 | from __future__ import division
import numpy as np
def evaluate(values, a=None):
if type(values) != np.ndarray:
raise TypeError("The argument `values` must be a numpy ndarray")
if a is None:
a = [0, 1, 4.5, 9, 99, 99, 99, 99]
ltz = values < 0
gto = values > 1
... | true | true |
f744ad915d92a2a0afec00047fc4453725d87d05 | 4,370 | py | Python | tests/test_event.py | dotlambda/home-assistant-cli | e8c5a493ca902a739a357d3053a2f09d589e9be1 | [
"Apache-2.0"
] | null | null | null | tests/test_event.py | dotlambda/home-assistant-cli | e8c5a493ca902a739a357d3053a2f09d589e9be1 | [
"Apache-2.0"
] | null | null | null | tests/test_event.py | dotlambda/home-assistant-cli | e8c5a493ca902a739a357d3053a2f09d589e9be1 | [
"Apache-2.0"
] | null | null | null | """Tests file for Home Assistant CLI (hass-cli)."""
import json
import re
from click.testing import CliRunner
import homeassistant_cli.cli as cli
import requests_mock
VALID_INFO = """[{
"attributes": {
"auto": true,
"entity_id": [
"remote.tv"
],
"friendly_name": "all remotes",
... | 24.550562 | 74 | 0.574142 | import json
import re
from click.testing import CliRunner
import homeassistant_cli.cli as cli
import requests_mock
VALID_INFO = """[{
"attributes": {
"auto": true,
"entity_id": [
"remote.tv"
],
"friendly_name": "all remotes",
"hidden": true,
"order": 16
},
"cont... | true | true |
f744ae57bc351350bf58e5c9430d72f82b610deb | 6,018 | py | Python | examples/plugin_s3_progressive_upload/miniwdl_s3_progressive_upload.py | kinow/miniwdl | 0463f5a418974691562085f2ff1bfe4b4a411aa0 | [
"MIT"
] | 2 | 2020-04-29T22:16:04.000Z | 2020-11-16T16:55:11.000Z | examples/plugin_s3_progressive_upload/miniwdl_s3_progressive_upload.py | kinow/miniwdl | 0463f5a418974691562085f2ff1bfe4b4a411aa0 | [
"MIT"
] | 1 | 2020-04-27T07:24:42.000Z | 2020-04-27T07:24:42.000Z | examples/plugin_s3_progressive_upload/miniwdl_s3_progressive_upload.py | kinow/miniwdl | 0463f5a418974691562085f2ff1bfe4b4a411aa0 | [
"MIT"
] | 4 | 2020-03-30T12:37:19.000Z | 2021-09-09T15:16:06.000Z | """
Plugin for uploading output files to S3 "progressively," meaning to upload each task's output files
immediately upon task completion, instead of waiting for the whole workflow to finish. (The latter
technique, which doesn't need a plugin at all, is illustrated in ../upload_output_files.sh)
To enable, install this ... | 38.576923 | 99 | 0.661848 |
import os
import subprocess
import threading
import json
import WDL
from WDL._util import StructuredLogMessage as _
_uploaded_files = {}
_uploaded_files_lock = threading.Lock()
def task(cfg, logger, run_id, run_dir, task, **recv):
logger = logger.getChild("s3_progressive_upload")
recv = yield recv
... | true | true |
f744ae9aedbe207b523b8c3765cdddd0c90ee23d | 37,913 | py | Python | django3_keycloak/oic/oauth2/message.py | ben-shearlaw/django_keycloak | f83742857c8dfb1ef1e200e9c5d80445f7f9753e | [
"MIT"
] | null | null | null | django3_keycloak/oic/oauth2/message.py | ben-shearlaw/django_keycloak | f83742857c8dfb1ef1e200e9c5d80445f7f9753e | [
"MIT"
] | null | null | null | django3_keycloak/oic/oauth2/message.py | ben-shearlaw/django_keycloak | f83742857c8dfb1ef1e200e9c5d80445f7f9753e | [
"MIT"
] | null | null | null | from future.backports.urllib.parse import urlencode
from future.moves.urllib.parse import parse_qs
from past.builtins import basestring
import copy
import json
import logging
from collections import MutableMapping
import six
from jwkest import as_unicode
from jwkest import b64d
from jwkest import jwe
from jwkest impo... | 32.45976 | 103 | 0.530346 | from future.backports.urllib.parse import urlencode
from future.moves.urllib.parse import parse_qs
from past.builtins import basestring
import copy
import json
import logging
from collections import MutableMapping
import six
from jwkest import as_unicode
from jwkest import b64d
from jwkest import jwe
from jwkest impo... | true | true |
f744af3570654a975d9f40f5fbbe93c13c984125 | 1,624 | py | Python | yt_dlp/WS_Extractor/pluralsight.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/WS_Extractor/pluralsight.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null | yt_dlp/WS_Extractor/pluralsight.py | evolution-ant/local-youtube-dl | e9be36e8cdc585c0e24a18c74d790b62af6e11a7 | [
"Unlicense"
] | null | null | null |
from ..utils import (
update_url_query,
int_or_none
)
from ..utilsEX import url_result
from ..extractor.pluralsight import PluralsightCourseIE as Old
class PluralsightCourseIE(Old):
def _real_extract(self, url):
course_id = self._match_id(url)
# TODO: PSM cookie
course = self.... | 31.843137 | 81 | 0.514778 |
from ..utils import (
update_url_query,
int_or_none
)
from ..utilsEX import url_result
from ..extractor.pluralsight import PluralsightCourseIE as Old
class PluralsightCourseIE(Old):
def _real_extract(self, url):
course_id = self._match_id(url)
course = self._download_course(c... | true | true |
f744afea056323014d6721575c7b7a0f493b2608 | 7,070 | py | Python | tests/conftest.py | sanyatuning/supervisor | 34f64b0ed00ccb4fcd4a60f903f7c8934c553a1c | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | sanyatuning/supervisor | 34f64b0ed00ccb4fcd4a60f903f7c8934c553a1c | [
"Apache-2.0"
] | 200 | 2020-10-13T06:35:51.000Z | 2022-03-31T06:03:35.000Z | tests/conftest.py | sanyatuning/supervisor | 34f64b0ed00ccb4fcd4a60f903f7c8934c553a1c | [
"Apache-2.0"
] | null | null | null | """Common test functions."""
from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
from awesomeversion import AwesomeVersion
import pytest
from supervisor.api import RestAPI
from s... | 29.214876 | 88 | 0.685714 | from pathlib import Path
import re
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
from uuid import uuid4
from aiohttp import web
from aiohttp.test_utils import TestClient
from awesomeversion import AwesomeVersion
import pytest
from supervisor.api import RestAPI
from supervisor.bootstrap import in... | true | true |
f744b122afa8136a4fc7881726d7bfcfc27f4936 | 10,070 | py | Python | doctr/models/recognition/crnn/tensorflow.py | fmobrj/doctr | b149266ea57fd59047193a01c328c2b8ecb9330a | [
"Apache-2.0"
] | null | null | null | doctr/models/recognition/crnn/tensorflow.py | fmobrj/doctr | b149266ea57fd59047193a01c328c2b8ecb9330a | [
"Apache-2.0"
] | null | null | null | doctr/models/recognition/crnn/tensorflow.py | fmobrj/doctr | b149266ea57fd59047193a01c328c2b8ecb9330a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
from copy import deepcopy
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.models import Sequ... | 35.457746 | 119 | 0.63853 |
from copy import deepcopy
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential, Model
from typing import Tuple, Dict, Any, Optional, List
from ...backbones import vgg16_bn, resnet31, mobilenet_v3_small_r, mobilenet_v3_large_r
from ...utils import load_pretrain... | true | true |
f744b2cca15804878a37097956a9abf9783168bf | 276 | py | Python | solutions/prblm_3.py | shivani-tomar/project_eular | 42eb0b510fc7474de6e9a8e75bdce100b3d5f6cf | [
"MIT"
] | 1 | 2019-03-29T08:36:04.000Z | 2019-03-29T08:36:04.000Z | solutions/prblm_3.py | shivani-tomar/project_eular | 42eb0b510fc7474de6e9a8e75bdce100b3d5f6cf | [
"MIT"
] | null | null | null | solutions/prblm_3.py | shivani-tomar/project_eular | 42eb0b510fc7474de6e9a8e75bdce100b3d5f6cf | [
"MIT"
] | null | null | null | import math
def large_prime_fact(num):
fact = 2
while(fact * fact <= num):
while num%fact == 0:
num /= fact
fact += 1
if num > 1:
return num
return fact
print(large_prime_fact(13195))
print(large_prime_fact(600851475143)) | 21.230769 | 37 | 0.586957 | import math
def large_prime_fact(num):
fact = 2
while(fact * fact <= num):
while num%fact == 0:
num /= fact
fact += 1
if num > 1:
return num
return fact
print(large_prime_fact(13195))
print(large_prime_fact(600851475143)) | true | true |
f744b2e086e228699190adee64a05aa55e655a99 | 44,879 | py | Python | squeaknode/admin/squeak_admin_server_handler.py | azernik/squeaknode | 3d29338d5674f55d1c4bc97a370053d43810559f | [
"MIT"
] | null | null | null | squeaknode/admin/squeak_admin_server_handler.py | azernik/squeaknode | 3d29338d5674f55d1c4bc97a370053d43810559f | [
"MIT"
] | null | null | null | squeaknode/admin/squeak_admin_server_handler.py | azernik/squeaknode | 3d29338d5674f55d1c4bc97a370053d43810559f | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Jonathan Zernik
#
# 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, mer... | 40.504513 | 111 | 0.671962 |
import logging
from proto import squeak_admin_pb2
from squeaknode.admin.messages import connected_peer_to_message
from squeaknode.admin.messages import download_result_to_message
from squeaknode.admin.messages import message_to_peer_address
from squeaknode.admin.messages import message_to_received... | true | true |
f744b32b0f667f5165cb2f9a002aa864b84d2ea8 | 4,879 | py | Python | spacy/tests/lang/uk/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 12 | 2019-03-20T20:43:47.000Z | 2020-04-13T11:10:52.000Z | spacy/tests/lang/uk/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 13 | 2018-06-05T11:54:40.000Z | 2019-07-02T11:33:14.000Z | spacy/tests/lang/uk/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 2 | 2020-02-15T18:33:35.000Z | 2022-02-13T14:11:41.000Z | # coding: utf-8
from __future__ import unicode_literals
import pytest
PUNCT_OPEN = ["(", "[", "{", "*"]
PUNCT_CLOSE = [")", "]", "}", "*"]
PUNCT_PAIRED = [("(", ")"), ("[", "]"), ("{", "}"), ("*", "*")]
@pytest.mark.parametrize("text", ["(", "((", "<"])
def test_uk_tokenizer_handles_only_punct(uk_tokenizer, text):... | 33.190476 | 88 | 0.682312 |
from __future__ import unicode_literals
import pytest
PUNCT_OPEN = ["(", "[", "{", "*"]
PUNCT_CLOSE = [")", "]", "}", "*"]
PUNCT_PAIRED = [("(", ")"), ("[", "]"), ("{", "}"), ("*", "*")]
@pytest.mark.parametrize("text", ["(", "((", "<"])
def test_uk_tokenizer_handles_only_punct(uk_tokenizer, text):
tokens = u... | true | true |
f744b3c296a8557cf76e40a7250a13914d98a8d4 | 112 | py | Python | uva_701/uva_701.py | stwklu/403_repo | 62ba70bf012a556137fea6e94dd8bf4f2e660a91 | [
"MIT"
] | null | null | null | uva_701/uva_701.py | stwklu/403_repo | 62ba70bf012a556137fea6e94dd8bf4f2e660a91 | [
"MIT"
] | 1 | 2018-01-16T05:56:28.000Z | 2018-02-03T04:29:08.000Z | uva_701/uva_701.py | stwklu/403_repo | 62ba70bf012a556137fea6e94dd8bf4f2e660a91 | [
"MIT"
] | null | null | null |
import sys
import math
def main():
for i in range(100000):
pow(2, i)
if __name__ == '__main__':
main() | 8.615385 | 26 | 0.625 |
import sys
import math
def main():
for i in range(100000):
pow(2, i)
if __name__ == '__main__':
main() | true | true |
f744b40c11793464cebf2fc6f6e2a5047d5b6751 | 19,651 | py | Python | freezer/scheduler/scheduler_job.py | mr-smart/freezer | b268bea3d10727bcc043eb26d1396411a40513c3 | [
"MIT"
] | null | null | null | freezer/scheduler/scheduler_job.py | mr-smart/freezer | b268bea3d10727bcc043eb26d1396411a40513c3 | [
"MIT"
] | null | null | null | freezer/scheduler/scheduler_job.py | mr-smart/freezer | b268bea3d10727bcc043eb26d1396411a40513c3 | [
"MIT"
] | 1 | 2019-12-03T15:38:27.000Z | 2019-12-03T15:38:27.000Z | """
Copyright 2015 Hewlett-Packard
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, softwar... | 34.904085 | 79 | 0.55529 |
import datetime
import json
import os
import subprocess
import tempfile
import time
from freezer.utils import utils
from oslo_config import cfg
from oslo_log import log
from six.moves import configparser
CONF = cfg.CONF
LOG = log.getLogger(__name__)
class StopState(object):
@staticmethod
def stop(job, do... | true | true |
f744b629facf402b28388080f85889a925a91a3e | 585 | py | Python | __manifest__.py | mchoccac/payment_visanet | 3a19be4f7a43a88bccc766d4866b3bea3c959d35 | [
"BSD-3-Clause"
] | null | null | null | __manifest__.py | mchoccac/payment_visanet | 3a19be4f7a43a88bccc766d4866b3bea3c959d35 | [
"BSD-3-Clause"
] | null | null | null | __manifest__.py | mchoccac/payment_visanet | 3a19be4f7a43a88bccc766d4866b3bea3c959d35 | [
"BSD-3-Clause"
] | 1 | 2021-09-03T19:30:30.000Z | 2021-09-03T19:30:30.000Z | # -*- coding: utf-8 -*-
{
'name': 'VisaNet Payment Acquirer',
'category': 'Accounting/Payment',
'summary': 'Payment Acquirer: VisaNet Implementation',
'version': '1.0',
'description': """VisaNet Payment Acquirer""",
'author': 'José Rodrigo Fernández Menegazzo',
'website': 'http://aquih.com/... | 29.25 | 61 | 0.623932 |
{
'name': 'VisaNet Payment Acquirer',
'category': 'Accounting/Payment',
'summary': 'Payment Acquirer: VisaNet Implementation',
'version': '1.0',
'description': """VisaNet Payment Acquirer""",
'author': 'José Rodrigo Fernández Menegazzo',
'website': 'http://aquih.com/',
'depends': ['pay... | true | true |
f744b7f2cd2c0f2fb95818308c2ec67cb0622b6b | 72,097 | py | Python | treetime/treeanc.py | emmahodcroft/treetime | 8926e49e17538c19ad0950e365f15035a76c8fc5 | [
"MIT"
] | 1 | 2021-01-02T11:52:02.000Z | 2021-01-02T11:52:02.000Z | treetime/treeanc.py | emmahodcroft/treetime | 8926e49e17538c19ad0950e365f15035a76c8fc5 | [
"MIT"
] | null | null | null | treetime/treeanc.py | emmahodcroft/treetime | 8926e49e17538c19ad0950e365f15035a76c8fc5 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import time
import config as ttconf
from Bio import Phylo
from Bio import AlignIO
import numpy as np
from gtr import GTR
import seq_utils
from version import tt_version as __version__
try:
from itertools import izip
except ImportError: #python3.x
izip = zip
cla... | 43.854623 | 1,080 | 0.620414 | from __future__ import print_function, division
import time
import config as ttconf
from Bio import Phylo
from Bio import AlignIO
import numpy as np
from gtr import GTR
import seq_utils
from version import tt_version as __version__
try:
from itertools import izip
except ImportError:
izip = zip
class TreeAnc... | true | true |
f744b86edbdb168059805ac5b9f469532597a4b4 | 395 | py | Python | setup.py | mshmsh5000/lofi-schools-flask | 6f10a67c5853d10b545ef402997ca4402298f17f | [
"MIT"
] | null | null | null | setup.py | mshmsh5000/lofi-schools-flask | 6f10a67c5853d10b545ef402997ca4402298f17f | [
"MIT"
] | null | null | null | setup.py | mshmsh5000/lofi-schools-flask | 6f10a67c5853d10b545ef402997ca4402298f17f | [
"MIT"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'LoFi',
'author': 'Desmond Morris',
'author_email': 'hi@desmondmorris.com',
'version': '0.0.1',
'install_requires': ['Flask', 'Flask-MongoEngine', 'nose'],
'packages': ['lofi... | 21.944444 | 63 | 0.612658 | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'LoFi',
'author': 'Desmond Morris',
'author_email': 'hi@desmondmorris.com',
'version': '0.0.1',
'install_requires': ['Flask', 'Flask-MongoEngine', 'nose'],
'packages': ['lofi... | true | true |
f744b9420a30e30160aacee91329c750e6009b7d | 593 | py | Python | apps/preference/migrations/0002_auto_20210322_1631.py | FeiChaiCom/django-netdisk | f9ef4f46a065527f0ace0a65f2b3210d1657b80f | [
"MIT"
] | 6 | 2021-05-22T12:23:29.000Z | 2022-01-01T01:38:29.000Z | apps/preference/migrations/0002_auto_20210322_1631.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | null | null | null | apps/preference/migrations/0002_auto_20210322_1631.py | gaomugong/django-netdisk | 5b2204f5087579bb6a26c6b92972a9f53bd05a7c | [
"MIT"
] | 1 | 2021-05-22T15:25:33.000Z | 2021-05-22T15:25:33.000Z | # Generated by Django 2.2.18 on 2021-03-22 16:31
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('preference', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='preference', options={'verbose_n... | 25.782609 | 105 | 0.620573 |
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('preference', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='preference', options={'verbose_name': '站点偏好', 'verbose_name_plural': '站点偏好'},
... | true | true |
f744b9a237fd980546647c1aa53bec484af81476 | 177 | py | Python | utils/content_processors.py | haisome/django-Julyblog | 272b0f240cb9695c742ae85a538a7e3e952474e4 | [
"MIT"
] | 1 | 2018-09-26T18:14:47.000Z | 2018-09-26T18:14:47.000Z | utils/content_processors.py | haisome/django-Julyblog | 272b0f240cb9695c742ae85a538a7e3e952474e4 | [
"MIT"
] | null | null | null | utils/content_processors.py | haisome/django-Julyblog | 272b0f240cb9695c742ae85a538a7e3e952474e4 | [
"MIT"
] | null | null | null | from July import settings
def static_git(request):
"""
Adds static-related context variables to the context.
"""
return {'staticgit': settings.STATIC_GIT_URL }
| 22.125 | 57 | 0.700565 | from July import settings
def static_git(request):
return {'staticgit': settings.STATIC_GIT_URL }
| true | true |
f744bc0e603de1d8671c793e970a78b3471a6980 | 13,627 | py | Python | ml-agents/mlagents/trainers/subprocess_env_manager.py | DemyCode/ml-agents | 238043d68b4195cd33c2b75d408dee39708ffb32 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/subprocess_env_manager.py | DemyCode/ml-agents | 238043d68b4195cd33c2b75d408dee39708ffb32 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/subprocess_env_manager.py | DemyCode/ml-agents | 238043d68b4195cd33c2b75d408dee39708ffb32 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, NamedTuple, List, Any, Optional, Callable, Set, Tuple
import cloudpickle
import enum
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.exception import (
UnityCommunicationException,
UnityTimeOutException,
UnityEnvironmentException,
)
from multiprocessing im... | 39.158046 | 116 | 0.649593 | from typing import Dict, NamedTuple, List, Any, Optional, Callable, Set, Tuple
import cloudpickle
import enum
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.exception import (
UnityCommunicationException,
UnityTimeOutException,
UnityEnvironmentException,
)
from multiprocessing im... | true | true |
f744bc103de1a23d0f9cfedbec4053fbe40a52c2 | 3,202 | py | Python | rboost/gui/listlabels.py | SimoneGasperini/rboost | 5e0108d821077da76964e1e797f0d775b3999f56 | [
"MIT"
] | 1 | 2021-02-06T17:44:00.000Z | 2021-02-06T17:44:00.000Z | rboost/gui/listlabels.py | SimoneGasperini/rboost | 5e0108d821077da76964e1e797f0d775b3999f56 | [
"MIT"
] | null | null | null | rboost/gui/listlabels.py | SimoneGasperini/rboost | 5e0108d821077da76964e1e797f0d775b3999f56 | [
"MIT"
] | null | null | null | import pandas as pd
from PySide2.QtWidgets import (
QWidget,
QHBoxLayout,
QVBoxLayout,
QFormLayout,
QTableView,
QPushButton,
QComboBox,
QHeaderView
)
from rboost.gui.utils.pandasmodel import PandasModel
class ListLabelsWindow(QWidget):
def __init__(self, rboost):
super().... | 33.354167 | 79 | 0.658651 | import pandas as pd
from PySide2.QtWidgets import (
QWidget,
QHBoxLayout,
QVBoxLayout,
QFormLayout,
QTableView,
QPushButton,
QComboBox,
QHeaderView
)
from rboost.gui.utils.pandasmodel import PandasModel
class ListLabelsWindow(QWidget):
def __init__(self, rboost):
super().... | true | true |
f744bc2692c90ac9f5dc7dd970daeba5a3d424b1 | 7,202 | py | Python | IMLearn/learners/gaussian_estimators.py | eladapplbaum/IML.HUJI | 6a08721e143b0d766f7085c70882f32f60088550 | [
"MIT"
] | null | null | null | IMLearn/learners/gaussian_estimators.py | eladapplbaum/IML.HUJI | 6a08721e143b0d766f7085c70882f32f60088550 | [
"MIT"
] | null | null | null | IMLearn/learners/gaussian_estimators.py | eladapplbaum/IML.HUJI | 6a08721e143b0d766f7085c70882f32f60088550 | [
"MIT"
] | null | null | null | from __future__ import annotations
import numpy as np
from numpy.linalg import inv, det, slogdet
class UnivariateGaussian:
"""
Class for univariate Gaussian Distribution Estimator
"""
def __init__(self, biased_var: bool = False) -> UnivariateGaussian:
"""
Estimator for univariate Gaus... | 31.177489 | 96 | 0.558178 | from __future__ import annotations
import numpy as np
from numpy.linalg import inv, det, slogdet
class UnivariateGaussian:
def __init__(self, biased_var: bool = False) -> UnivariateGaussian:
self.biased_ = biased_var
self.fitted_, self.mu_, self.var_ = False, None, None
def fit(self, X: np.n... | true | true |
f744bc4aa189ab6a7d41793c8fff1ba2e071fbea | 273 | py | Python | arlo/arlo_arm.py | nicklasl/home_automation_scripts | 7143a4e92f3d17cf33ccb4e0cd2b8c27e08657c4 | [
"Unlicense"
] | null | null | null | arlo/arlo_arm.py | nicklasl/home_automation_scripts | 7143a4e92f3d17cf33ccb4e0cd2b8c27e08657c4 | [
"Unlicense"
] | null | null | null | arlo/arlo_arm.py | nicklasl/home_automation_scripts | 7143a4e92f3d17cf33ccb4e0cd2b8c27e08657c4 | [
"Unlicense"
] | null | null | null | from Arlo import Arlo
import config
USERNAME = config.key("ARLO_USERNAME")
PASSWORD = config.key("ARLO_PASSWORD")
try:
arlo = Arlo(USERNAME, PASSWORD)
basestations = arlo.GetDevices('basestation')
arlo.Arm(basestations[0])
except Exception as e:
print(e) | 21 | 49 | 0.725275 | from Arlo import Arlo
import config
USERNAME = config.key("ARLO_USERNAME")
PASSWORD = config.key("ARLO_PASSWORD")
try:
arlo = Arlo(USERNAME, PASSWORD)
basestations = arlo.GetDevices('basestation')
arlo.Arm(basestations[0])
except Exception as e:
print(e) | true | true |
f744bd0c31a4008c88cca10979521d1299a56aab | 263 | py | Python | statespacetimeseries/state.py | nunoskew/state-space-timeseries | 80ddf8dbd6515e6b1fbce23a592e26bab531886d | [
"Apache-2.0"
] | null | null | null | statespacetimeseries/state.py | nunoskew/state-space-timeseries | 80ddf8dbd6515e6b1fbce23a592e26bab531886d | [
"Apache-2.0"
] | null | null | null | statespacetimeseries/state.py | nunoskew/state-space-timeseries | 80ddf8dbd6515e6b1fbce23a592e26bab531886d | [
"Apache-2.0"
] | null | null | null | from statespacetimeseries.random_variables import MVN
class State(MVN):
""" The State object required for Kalman Filter. """
def __init__(self, mean, cov, variance):
super().__init__(mean, cov, variance)
self.prediction = None
| 26.3 | 57 | 0.665399 | from statespacetimeseries.random_variables import MVN
class State(MVN):
def __init__(self, mean, cov, variance):
super().__init__(mean, cov, variance)
self.prediction = None
| true | true |
f744be04cd749e4e2e7296e40a8fc09e65eba153 | 600 | py | Python | learning_logs/migrations/0003_topic_owner.py | jwinternet/learning_log | 5de0ba9c0d1a767b54afc3338570f85e8479880d | [
"MIT"
] | null | null | null | learning_logs/migrations/0003_topic_owner.py | jwinternet/learning_log | 5de0ba9c0d1a767b54afc3338570f85e8479880d | [
"MIT"
] | null | null | null | learning_logs/migrations/0003_topic_owner.py | jwinternet/learning_log | 5de0ba9c0d1a767b54afc3338570f85e8479880d | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-18 19:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('learning_logs', '0002_entr... | 26.086957 | 108 | 0.656667 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('learning_logs', '0002_entry'),
]
operations = [
migrat... | true | true |
f744be51fb9a50e5106047c0ced4a06201c0e27f | 122 | py | Python | apps/TCPB_-_Expressions/src/literal.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_Expressions/src/literal.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | apps/TCPB_-_Expressions/src/literal.py | majacQ/threatconnect-playbooks | 81262fc732844f08d99649a795feb978f5ed6364 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Literal classes"""
class literal(str):
"""literal"""
class tcvar(str):
"""tcvar"""
| 11.090909 | 23 | 0.52459 |
class literal(str):
class tcvar(str):
| true | true |
f744be5be1a8b8d62f78213f399a8e4d5c1c923d | 4,880 | py | Python | EasyShop-Chat/Chat/consumers.py | Souryaman/EasyShop | c273a5f091154d74bb2ea5f9e7bb6c61f7b887e0 | [
"MIT"
] | null | null | null | EasyShop-Chat/Chat/consumers.py | Souryaman/EasyShop | c273a5f091154d74bb2ea5f9e7bb6c61f7b887e0 | [
"MIT"
] | null | null | null | EasyShop-Chat/Chat/consumers.py | Souryaman/EasyShop | c273a5f091154d74bb2ea5f9e7bb6c61f7b887e0 | [
"MIT"
] | 2 | 2021-04-06T08:18:41.000Z | 2021-04-06T08:26:06.000Z | import json
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
Rooms = {}
def AddToRoom(RoomName, UserID):
if RoomName in Rooms:
if UserID not in Rooms[RoomName]:
Rooms[RoomName].append(UserID)
else:
Rooms.update({f"{RoomName}": []})
... | 31.688312 | 65 | 0.486066 | import json
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
Rooms = {}
def AddToRoom(RoomName, UserID):
if RoomName in Rooms:
if UserID not in Rooms[RoomName]:
Rooms[RoomName].append(UserID)
else:
Rooms.update({f"{RoomName}": []})
... | true | true |
f744c19a1b39731c596c141ce2c1775192fec723 | 1,804 | py | Python | backend/stat/normality_tests.py | Julian-Theis/stat-kiste | b436e881c5ad79781a60dc767c08aa1165e4fb8b | [
"MIT"
] | 3 | 2020-12-22T12:08:58.000Z | 2021-05-11T00:43:45.000Z | backend/stat/normality_tests.py | Julian-Theis/stat-kiste | b436e881c5ad79781a60dc767c08aa1165e4fb8b | [
"MIT"
] | null | null | null | backend/stat/normality_tests.py | Julian-Theis/stat-kiste | b436e881c5ad79781a60dc767c08aa1165e4fb8b | [
"MIT"
] | 1 | 2020-09-07T21:05:47.000Z | 2020-09-07T21:05:47.000Z | """
Code originates from: https://machinelearningmastery.com/a-gentle-introduction-to-normality-tests-in-python/
"""
from scipy.stats import shapiro, normaltest, anderson
"""
Shapiro-Wilk Test of Normality
The Shapiro-Wilk Test is more appropriate for small sample sizes (< 50 samples), but can also handle sample siz... | 39.217391 | 131 | 0.657428 |
from scipy.stats import shapiro, normaltest, anderson
def run_shapiro_wilk_normality_test(data, alpha=0.05, print_results=True):
stat, p = shapiro(data)
if print_results:
print('Statistics=%.3f, p=%.3f' % (stat, p))
if p > alpha:
print('Sample looks Gaussian (fail to reject H0) at ... | true | true |
f744c2afc8e18bf2f257f14168bc15ab64fb76e0 | 2,269 | py | Python | hybridtfidf/utils.py | JamalRahman/hybridtfidf | 0409aae0083b1eae32c1a049f87f484740289be1 | [
"MIT"
] | 4 | 2020-06-04T00:10:54.000Z | 2021-10-30T01:58:45.000Z | hybridtfidf/utils.py | JamalRahman/hybridtfidf | 0409aae0083b1eae32c1a049f87f484740289be1 | [
"MIT"
] | null | null | null | hybridtfidf/utils.py | JamalRahman/hybridtfidf | 0409aae0083b1eae32c1a049f87f484740289be1 | [
"MIT"
] | 2 | 2020-06-04T22:08:20.000Z | 2021-04-22T20:32:37.000Z | from numpy.linalg import norm
from numpy import dot
def cosine_sim(vec1, vec2):
"""Calculates the cosine similarity between two vectors
Args:
vec1 (list of float): A vector
vec2 (list of float): A vector
Returns:
The cosine similarity between the two input vectors
... | 33.367647 | 114 | 0.623182 | from numpy.linalg import norm
from numpy import dot
def cosine_sim(vec1, vec2):
return dot(vec1, vec2) / (norm(vec1) * norm(vec2))
def select_salient_posts(post_vectors, post_weights, k=10, similarity_threshold=0.4):
sorted_keyed_vectors = [z for _, z in sorted(zip(post_weights, enumerate(post_ve... | true | true |
f744c3f13a7b16468661846d09ddd3579e5bb6dd | 5,479 | py | Python | pyasn-utils/pyasn_util_convert.py | FlowGuard/pyasn | d39a8d81765705e4c96d250b054fbd890e9e3382 | [
"MIT"
] | null | null | null | pyasn-utils/pyasn_util_convert.py | FlowGuard/pyasn | d39a8d81765705e4c96d250b054fbd890e9e3382 | [
"MIT"
] | null | null | null | pyasn-utils/pyasn_util_convert.py | FlowGuard/pyasn | d39a8d81765705e4c96d250b054fbd890e9e3382 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2009-2017 Hadi Asghari
#
# 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, m... | 46.82906 | 99 | 0.656142 |
from __future__ import print_function, division
from pyasn import mrtx, __version__
from time import time
from sys import argv, exit, stdout
from glob import glob
from datetime import datetime, timedelta
from subprocess import call
from argparse import ArgumentParser
parser = ArgumentParser... | true | true |
f744c41a8302bd8ceb29f680a192a723e256d71f | 2,989 | py | Python | nunif/cli/waifu2x.py | jb2020-super/nunif | eab6952d93e85951ed4e4cff30cd26c09e1dbb63 | [
"MIT"
] | 18 | 2020-05-21T18:52:19.000Z | 2022-03-07T08:47:00.000Z | nunif/cli/waifu2x.py | jb2020-super/nunif | eab6952d93e85951ed4e4cff30cd26c09e1dbb63 | [
"MIT"
] | 1 | 2021-03-24T03:47:50.000Z | 2021-03-24T03:47:50.000Z | nunif/cli/waifu2x.py | jb2020-super/nunif | eab6952d93e85951ed4e4cff30cd26c09e1dbb63 | [
"MIT"
] | 3 | 2021-02-18T08:51:26.000Z | 2022-02-16T09:01:18.000Z | # waifu2x
import os
from os import path
import torch
import argparse
import csv
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor as PoolExecutor
from .. logger import logger
from .. utils import load_image, save_image, ImageLoader
from .. tasks.waifu2x import Waifu2x
if os.getenv("NUNIF_MODEL_DI... | 40.945205 | 132 | 0.666444 |
import os
from os import path
import torch
import argparse
import csv
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor as PoolExecutor
from .. logger import logger
from .. utils import load_image, save_image, ImageLoader
from .. tasks.waifu2x import Waifu2x
if os.getenv("NUNIF_MODEL_DIR") is no... | true | true |
f744c4b09bafb4e57431c1dde3eb8b3ce9b16ac6 | 2,309 | py | Python | notebooks/figures/plot_interactive_tree.py | fordanic/cmiv-ai-course | c51e51485d18c38bece67d6bcb3bd7422b56da97 | [
"MIT"
] | 7 | 2018-10-24T13:53:34.000Z | 2022-03-09T21:13:05.000Z | notebooks/figures/plot_interactive_tree.py | fordanic/cmiv-ai-course | c51e51485d18c38bece67d6bcb3bd7422b56da97 | [
"MIT"
] | null | null | null | notebooks/figures/plot_interactive_tree.py | fordanic/cmiv-ai-course | c51e51485d18c38bece67d6bcb3bd7422b56da97 | [
"MIT"
] | 1 | 2019-10-23T11:51:05.000Z | 2019-10-23T11:51:05.000Z | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO # doctest: +SKIP
from sklearn.tree import export_graphviz
from scipy.misc import imread
from scipy import ndimage
import re
X, y = ma... | 32.521127 | 84 | 0.608922 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.tree import DecisionTreeClassifier
from sklearn.externals.six import StringIO
from sklearn.tree import export_graphviz
from scipy.misc import imread
from scipy import ndimage
import re
X, y = make_blobs(centers... | true | true |
f744c6568b394e0adcb1fb48d100b4278d61119e | 1,163 | py | Python | book-making-games/2-minimal-gui-single-pixel.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | book-making-games/2-minimal-gui-single-pixel.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | book-making-games/2-minimal-gui-single-pixel.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 15 18:09:41 2020
@author: crtom
"""
import pygame
import sys
from pygame.locals import * # this is for shortcut pygame.QUIT -> QUIT
def drawPoint(x,y,color):
s = pygame.Surface((1,1)) # the object surface 1 x 1 pixel (a point!)
s.fill(color) #... | 23.734694 | 88 | 0.618229 |
import pygame
import sys
from pygame.locals import *
def drawPoint(x,y,color):
s = pygame.Surface((1,1))
s.fill(color)
r,r.x,r.y = s.get_rect(),x,y
screen.blit(s,r)
pygame.init()
DISPLAYSURF = pygame.display.set_mode((400,300))
pygame.display.set_capt... | true | true |
f744c6b3a9b29c5311f81a16792e0c1d4523ce70 | 11,118 | py | Python | simulations.py | erelsgl/fair-diminishing-differences | ae64ff4a4c6cfde5a1261e67484c905414607d36 | [
"MIT"
] | null | null | null | simulations.py | erelsgl/fair-diminishing-differences | ae64ff4a4c6cfde5a1261e67484c905414607d36 | [
"MIT"
] | null | null | null | simulations.py | erelsgl/fair-diminishing-differences | ae64ff4a4c6cfde5a1261e67484c905414607d36 | [
"MIT"
] | null | null | null | #!python3
"""
Utilities for conducting simulations on random utility profiles.
Author: Erel Segai-Halevi
Date: 2019-07
"""
import pandas, numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
from partitions import equalPartitions
import operator
from timeit import default_timer as timer
from P... | 47.110169 | 150 | 0.582839 |
import pandas, numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
from partitions import equalPartitions
import operator
from timeit import default_timer as timer
from PrefProfile import PrefProfile
from mean_and_stderr import mean_and_stderr
trace = lambda *x: None
def avergeOverRandomPr... | true | true |
f744c7d46db6f7b29e4e010101a4a0b1bcf1e68a | 1,800 | py | Python | src/python/pants/backend/python/lint/black/subsystem.py | gshuflin/pants | cf483ead6d4d4a4cc4fc4ae18e3b5b633509d933 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/black/subsystem.py | gshuflin/pants | cf483ead6d4d4a4cc4fc4ae18e3b5b633509d933 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/black/subsystem.py | gshuflin/pants | cf483ead6d4d4a4cc4fc4ae18e3b5b633509d933 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from typing import Optional, Tuple, cast
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
from pants.option.custom_types import file_option, shell_str
class B... | 30.508475 | 94 | 0.596111 |
from typing import Optional, Tuple, cast
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
from pants.option.custom_types import file_option, shell_str
class Black(PythonToolBase):
options_scope = "black"
default_version = "black==20.8b1"
default_extra_requirements = ["setup... | true | true |
f744c7f31dda620341c30f5686a2af77e4ca8d2a | 1,273 | py | Python | tests/xop_test.py | remifan/commplax | e8ee5bc86ab0dfd90773202579237ecf42488cd0 | [
"Apache-2.0"
] | 20 | 2021-03-09T08:33:51.000Z | 2021-11-29T05:04:55.000Z | tests/xop_test.py | remifan/commplax | e8ee5bc86ab0dfd90773202579237ecf42488cd0 | [
"Apache-2.0"
] | null | null | null | tests/xop_test.py | remifan/commplax | e8ee5bc86ab0dfd90773202579237ecf42488cd0 | [
"Apache-2.0"
] | 6 | 2021-03-09T08:34:01.000Z | 2021-12-03T15:14:42.000Z | from commplax import xop
import numpy as np
from jax import random, numpy as jnp
def conv_input_complex(n, m):
key1 = random.PRNGKey(0)
key2 = random.PRNGKey(1)
k1, k2 = random.split(key1)
k3, k4 = random.split(key2)
x = random.normal(k1, (n,)) + 1j * random.normal(k2, (n,))
h = random.normal(... | 31.04878 | 104 | 0.523174 | from commplax import xop
import numpy as np
from jax import random, numpy as jnp
def conv_input_complex(n, m):
key1 = random.PRNGKey(0)
key2 = random.PRNGKey(1)
k1, k2 = random.split(key1)
k3, k4 = random.split(key2)
x = random.normal(k1, (n,)) + 1j * random.normal(k2, (n,))
h = random.normal(... | true | true |
f744c8b4cd2ea08c9b2afec3e264397b1d559644 | 4,906 | py | Python | app/grandchallenge/reader_studies/serializers.py | pushpanjalip/grand-challenge.org | 607a30c9fe0e603b79f7b49dc9efeb48a484ebfc | [
"Apache-2.0"
] | 1 | 2021-02-09T10:30:44.000Z | 2021-02-09T10:30:44.000Z | app/grandchallenge/reader_studies/serializers.py | pushpanjalip/grand-challenge.org | 607a30c9fe0e603b79f7b49dc9efeb48a484ebfc | [
"Apache-2.0"
] | null | null | null | app/grandchallenge/reader_studies/serializers.py | pushpanjalip/grand-challenge.org | 607a30c9fe0e603b79f7b49dc9efeb48a484ebfc | [
"Apache-2.0"
] | null | null | null | from django.core.exceptions import ValidationError
from rest_framework.fields import CharField, ReadOnlyField
from rest_framework.relations import HyperlinkedRelatedField, SlugRelatedField
from rest_framework.serializers import (
HyperlinkedModelSerializer,
ModelSerializer,
SerializerMethodField,
)
from gr... | 31.651613 | 81 | 0.597839 | from django.core.exceptions import ValidationError
from rest_framework.fields import CharField, ReadOnlyField
from rest_framework.relations import HyperlinkedRelatedField, SlugRelatedField
from rest_framework.serializers import (
HyperlinkedModelSerializer,
ModelSerializer,
SerializerMethodField,
)
from gr... | true | true |
f744c9768a738529b684edcea221a431d893e241 | 6,413 | py | Python | log.py | honmaple/maple-tail | e58dad411d16d28e78f03bac9163c411aad0c712 | [
"BSD-3-Clause"
] | null | null | null | log.py | honmaple/maple-tail | e58dad411d16d28e78f03bac9163c411aad0c712 | [
"BSD-3-Clause"
] | null | null | null | log.py | honmaple/maple-tail | e58dad411d16d28e78f03bac9163c411aad0c712 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ********************************************************************************
# Copyright © 2018 honmaple
# File Name: log.py
# Author: honmaple
# Email: xiyang0807@gmail.com
# Created: 2018-03-26 17:49:35 (CST)
# Last Update: Thursday 2018-04-12 10:31:23 (CST)
# ... | 27.761905 | 86 | 0.565882 |
from tornado.websocket import WebSocketHandler
from tornado.escape import json_decode
from tornado import ioloop
from tornado.web import Application, RequestHandler
from tornado.template import Template
from tornado.options import (define, options, parse_command_line)
import os
import sys
TEMPLATE = Templa... | true | true |
f744c9d5742b4edd9e9bdb905bd9543521b685d4 | 1,053 | py | Python | mwp_solver/module/Graph/gcn.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | mwp_solver/module/Graph/gcn.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | mwp_solver/module/Graph/gcn.py | max-stack/MWP-SS-Metrics | 01268f2d6da716596216b04de4197e345b96c219 | [
"MIT"
] | null | null | null | # Code Taken from https://github.com/LYH-YF/MWPToolkit
# -*- encoding: utf-8 -*-
# @Author: Yihuai Lan
# @Time: 2021/08/29 21:49:49
# @File: gcn.py
import torch
from torch import nn
from torch.nn import functional as F
from module.Layer.graph_layers import GraphConvolution
class GCN(nn.Module):
def __init__(se... | 30.970588 | 89 | 0.639126 |
import torch
from torch import nn
from torch.nn import functional as F
from module.Layer.graph_layers import GraphConvolution
class GCN(nn.Module):
def __init__(self, in_feat_dim, nhid, out_feat_dim, dropout):
super(GCN, self).__init__()
self.gc1 = GraphConvolution(in_feat_dim, nhid)
... | true | true |
f744cb62723aac06d7af3ba689ca377319e5ae3c | 972 | py | Python | SoftLayer/CLI/iscsi/cancel.py | corneil/softlayer-python | bbaf562fb76536c5cc652e356729723f38f48b66 | [
"MIT"
] | 1 | 2019-11-06T13:54:07.000Z | 2019-11-06T13:54:07.000Z | SoftLayer/CLI/iscsi/cancel.py | underscorephil/softlayer-python | 567540a328d5258e55594466127cd22b9a04a2ea | [
"MIT"
] | null | null | null | SoftLayer/CLI/iscsi/cancel.py | underscorephil/softlayer-python | 567540a328d5258e55594466127cd22b9a04a2ea | [
"MIT"
] | 1 | 2020-07-07T12:18:26.000Z | 2020-07-07T12:18:26.000Z | """Cancel an existing iSCSI account."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@click... | 31.354839 | 77 | 0.727366 |
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
@click.command()
@click.argument('identifier')
@click.option('--reason', help="An optional reason for cancellation")
@click.option('--immed... | true | true |
f744cbcd89de6fb33464d23cc92cac62c2254896 | 8,991 | py | Python | applications/zcomx/modules/html/meta.py | zcomx/zco.mx | 70a7372af5787c2e4dea14b25bab0bbb2b959881 | [
"BSD-3-Clause"
] | null | null | null | applications/zcomx/modules/html/meta.py | zcomx/zco.mx | 70a7372af5787c2e4dea14b25bab0bbb2b959881 | [
"BSD-3-Clause"
] | null | null | null | applications/zcomx/modules/html/meta.py | zcomx/zco.mx | 70a7372af5787c2e4dea14b25bab0bbb2b959881 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Classes and functions related to HTML meta data.
"""
from applications.zcomx.modules.books import \
html_metadata as book_metadata
from applications.zcomx.modules.creators import \
html_metadata as creator_metadata
from applications.zcomx.modules.zco import \
... | 31.003448 | 77 | 0.570348 |
from applications.zcomx.modules.books import \
html_metadata as book_metadata
from applications.zcomx.modules.creators import \
html_metadata as creator_metadata
from applications.zcomx.modules.zco import \
html_metadata as site_metadata
class BaseMetaPreparer(object):
def __init__(self, metadata)... | true | true |
f744cc146631121ff65e251a7407144c89cf2f2d | 41,971 | py | Python | mplc/multi_partner_learning/basic_mpl.py | SubstraFoundation/distributed-learning-contributivity | b3fe85ab1b57896a304474727b7a041e559ee713 | [
"Apache-2.0"
] | 47 | 2019-10-16T15:46:51.000Z | 2021-10-03T10:56:47.000Z | mplc/multi_partner_learning/basic_mpl.py | SubstraFoundation/distributed-learning-contributivity | b3fe85ab1b57896a304474727b7a041e559ee713 | [
"Apache-2.0"
] | 280 | 2019-10-11T09:28:15.000Z | 2021-09-30T19:37:29.000Z | mplc/multi_partner_learning/basic_mpl.py | LabeliaLabs/distributed-learning-contributivity | 170ed8a660f7d7b4972c140f27782e085c4d63db | [
"Apache-2.0"
] | 12 | 2019-11-08T13:53:57.000Z | 2021-09-30T16:55:59.000Z | # -*- coding: utf-8 -*-
"""
Functions for model training and evaluation (single-partner and multi-partner cases)
"""
import operator
import os
from abc import ABC, abstractmethod
from copy import deepcopy
from timeit import default_timer as timer
import numpy as np
import random
import tensorflow as tf
from loguru im... | 44.60255 | 117 | 0.622525 |
import operator
import os
from abc import ABC, abstractmethod
from copy import deepcopy
from timeit import default_timer as timer
import numpy as np
import random
import tensorflow as tf
from loguru import logger
from sklearn.metrics import confusion_matrix
from tensorflow.keras import Input, Model
from tensorflow.k... | true | true |
f744cc14a20c22377f8a1ddcb4816d16675beb1c | 589 | py | Python | common/migrations/0020_auto_20200409_1653.py | Xcov19/Django-CRM | ed88b38525b5a049b15335277cd6220980ad96e3 | [
"MIT"
] | 2 | 2020-07-28T12:32:57.000Z | 2020-08-20T11:47:07.000Z | common/migrations/0020_auto_20200409_1653.py | Xcov19/Django-CRM | ed88b38525b5a049b15335277cd6220980ad96e3 | [
"MIT"
] | null | null | null | common/migrations/0020_auto_20200409_1653.py | Xcov19/Django-CRM | ed88b38525b5a049b15335277cd6220980ad96e3 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-04-09 11:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0019_auto_20200401_0941'),
]
operations = [
migrations.AlterField(
model_name='company',
name='address',
... | 24.541667 | 75 | 0.589134 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0019_auto_20200401_0941'),
]
operations = [
migrations.AlterField(
model_name='company',
name='address',
field=models.CharField(blank=True, m... | true | true |
f744cc3c92dda295703e5cb0da4fa3a1fd7d7102 | 12,798 | py | Python | Canary_Training/quick_start_example_notebooks/3_bert_fine_tuning_canary_train_example/code/.ipynb_checkpoints/train_deploy-checkpoint.py | aws-samples/amazon-sagemaker-predict-training-resource-usage | a2926c7b5727197e2123679ddc8a6993425df2ec | [
"Apache-2.0"
] | 7 | 2022-03-25T17:59:28.000Z | 2022-03-28T12:37:10.000Z | Canary_Training/quick_start_example_notebooks/3_bert_fine_tuning_canary_train_example/code/.ipynb_checkpoints/train_deploy-checkpoint.py | aws-samples/amazon-sagemaker-predict-training-resource-usage | a2926c7b5727197e2123679ddc8a6993425df2ec | [
"Apache-2.0"
] | null | null | null | Canary_Training/quick_start_example_notebooks/3_bert_fine_tuning_canary_train_example/code/.ipynb_checkpoints/train_deploy-checkpoint.py | aws-samples/amazon-sagemaker-predict-training-resource-usage | a2926c7b5727197e2123679ddc8a6993425df2ec | [
"Apache-2.0"
] | 1 | 2022-03-31T13:24:13.000Z | 2022-03-31T13:24:13.000Z | import argparse
import json
import logging
import os
import sys
import numpy as np
import pandas as pd
import torch
import torch.distributed as dist
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader, RandomSampler, TensorDataset
from transformers import AdamW, BertForS... | 37.203488 | 117 | 0.639241 | import argparse
import json
import logging
import os
import sys
import numpy as np
import pandas as pd
import torch
import torch.distributed as dist
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader, RandomSampler, TensorDataset
from transformers import AdamW, BertForS... | true | true |
f744cc9239a0860dd9ce8f43235f60862300d3ba | 4,084 | py | Python | gravity/process_manager/__init__.py | nsoranzo/gravity | 42e83ea4a5ad4e1a72d33c1ed4bddd2915268e1b | [
"MIT"
] | null | null | null | gravity/process_manager/__init__.py | nsoranzo/gravity | 42e83ea4a5ad4e1a72d33c1ed4bddd2915268e1b | [
"MIT"
] | null | null | null | gravity/process_manager/__init__.py | nsoranzo/gravity | 42e83ea4a5ad4e1a72d33c1ed4bddd2915268e1b | [
"MIT"
] | null | null | null | """ Galaxy Process Management superclass and utilities
"""
import contextlib
import importlib
import inspect
import os
import subprocess
import sys
from abc import ABCMeta, abstractmethod
from gravity.config_manager import ConfigManager
from gravity.io import error
from gravity.util import which
# If at some point ... | 34.610169 | 139 | 0.640304 |
import contextlib
import importlib
import inspect
import os
import subprocess
import sys
from abc import ABCMeta, abstractmethod
from gravity.config_manager import ConfigManager
from gravity.io import error
from gravity.util import which
@contextlib.contextmanager
def process_manager(*args, **kwargs):
# roule... | true | true |
f744ccc567704edea46e04e82bcb446f3b901cdd | 863 | py | Python | tests/opencl/test_summary.py | dabreegster/RAMP-UA | 04b7473aed441080ee10b6f68eb8b9135dac6879 | [
"MIT"
] | 10 | 2020-07-01T15:04:28.000Z | 2021-11-01T17:04:27.000Z | tests/opencl/test_summary.py | dabreegster/RAMP-UA | 04b7473aed441080ee10b6f68eb8b9135dac6879 | [
"MIT"
] | 229 | 2020-05-12T12:21:57.000Z | 2022-03-22T09:40:12.000Z | tests/opencl/test_summary.py | dabreegster/RAMP-UA | 04b7473aed441080ee10b6f68eb8b9135dac6879 | [
"MIT"
] | 10 | 2020-04-29T16:17:28.000Z | 2021-12-23T13:11:30.000Z | import numpy as np
from microsim.opencl.ramp.summary import Summary
from microsim.opencl.ramp.snapshot import Snapshot
def test_summary_update():
npeople = 50 + 34 + 101 + 551
summary = Summary(snapshot=Snapshot.random(nplaces=10, npeople=npeople, nslots=10), max_time=20)
time = 10
stat... | 28.766667 | 101 | 0.640788 | import numpy as np
from microsim.opencl.ramp.summary import Summary
from microsim.opencl.ramp.snapshot import Snapshot
def test_summary_update():
npeople = 50 + 34 + 101 + 551
summary = Summary(snapshot=Snapshot.random(nplaces=10, npeople=npeople, nslots=10), max_time=20)
time = 10
stat... | true | true |
f744cf2ea3e7b429cb220c619cd95c3d12deba02 | 5,787 | py | Python | python/marvin/contrib/vacs/gema.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | null | null | null | python/marvin/contrib/vacs/gema.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | null | null | null | python/marvin/contrib/vacs/gema.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | null | null | null | # !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2018-10-11 17:51:43
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-11-29 17:23:15
from __future__ import print_function, division, absolute_import
from astropy.io import f... | 38.838926 | 285 | 0.614654 |
from __future__ import print_function, division, absolute_import
from astropy.io import fits
import marvin.tools
from marvin import log
from .base import VACMixIn
class GEMAVAC(VACMixIn):
name = 'gema'
description = 'Returns GEMA table data'
version = {'MPL-7': '1.0.1', 'DR15': '1.0.1', ... | true | true |
f744d26311e3e426bd343c2605bb2137b822d115 | 1,552 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Demo/tkinter/matt/bind-w-mult-calls-p-type.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | David and Pooja/++Validating Linked Mods/Python-3.0/Demo/tkinter/matt/bind-w-mult-calls-p-type.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | David and Pooja/++Validating Linked Mods/Python-3.0/Demo/tkinter/matt/bind-w-mult-calls-p-type.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2021-11-05T20:45:57.000Z | 2021-11-05T20:45:57.000Z | from Tkinter import *
import string
# This program shows how to use a simple type-in box
class App(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.entrythingy = Entry()
self.entrythingy.pack()
# and here we get a callback when the u... | 34.488889 | 77 | 0.681057 | from Tkinter import *
import string
class App(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.entrythingy = Entry()
self.entrythingy.pack()
self.entrythingy.bind('<Key-Return>', self.print_contents)
... | true | true |
f744d29c2649c99f0ec5d3a07185fa53b003d884 | 329 | py | Python | Projects/ESP32Micropython/webcam2.py | TizioMaurizio/ArduinoWorkshop | d38ede91c6b7a925eafb0272a5fa9f44885ae017 | [
"MIT"
] | null | null | null | Projects/ESP32Micropython/webcam2.py | TizioMaurizio/ArduinoWorkshop | d38ede91c6b7a925eafb0272a5fa9f44885ae017 | [
"MIT"
] | null | null | null | Projects/ESP32Micropython/webcam2.py | TizioMaurizio/ArduinoWorkshop | d38ede91c6b7a925eafb0272a5fa9f44885ae017 | [
"MIT"
] | null | null | null | import camera
from machine import UART
import machine
led = machine.Pin(4, machine.Pin.OUT)
machine.sleep(5000)
led.on()
uart = UART(1, 9600) # init with given baudrate
uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
camera.init()
buf = camera.capture()
camera.deinit()
... | 27.416667 | 73 | 0.68997 | import camera
from machine import UART
import machine
led = machine.Pin(4, machine.Pin.OUT)
machine.sleep(5000)
led.on()
uart = UART(1, 9600)
uart.init(9600, bits=8, parity=None, stop=1)
camera.init()
buf = camera.capture()
camera.deinit()
led.off() | true | true |
f744d340724a5b7925ecfbe3395490c08b84258c | 37,586 | py | Python | mars/dataframe/datasource/tests/test_datasource_execution.py | vcfgv/mars | ef9e2282208798a5a82e9f9a19538ac92bafee8d | [
"Apache-2.0"
] | null | null | null | mars/dataframe/datasource/tests/test_datasource_execution.py | vcfgv/mars | ef9e2282208798a5a82e9f9a19538ac92bafee8d | [
"Apache-2.0"
] | null | null | null | mars/dataframe/datasource/tests/test_datasource_execution.py | vcfgv/mars | ef9e2282208798a5a82e9f9a19538ac92bafee8d | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.212719 | 111 | 0.619912 |
import os
import tempfile
import time
from collections import OrderedDict
from datetime import datetime
from string import printable
import numpy as np
import pandas as pd
import pytest
try:
import pyarrow as pa
except ImportError:
pa = None
try:
import fastparquet
except ImportError:
... | true | true |
f744d361400df082b782275e5efbe7c3533a0cba | 1,923 | py | Python | doc/dashboard/gen_data.py | ChristopherKotthoff/Aphros-with-GraphContraction | 18af982a50e350a8bf6979ae5bd25b2ef4d3792a | [
"MIT"
] | 252 | 2020-06-03T16:01:59.000Z | 2022-03-30T14:06:32.000Z | doc/dashboard/gen_data.py | ChristopherKotthoff/Aphros-with-GraphContraction | 18af982a50e350a8bf6979ae5bd25b2ef4d3792a | [
"MIT"
] | 4 | 2021-03-13T11:13:55.000Z | 2022-03-31T15:11:22.000Z | doc/dashboard/gen_data.py | ChristopherKotthoff/Aphros-with-GraphContraction | 18af982a50e350a8bf6979ae5bd25b2ef4d3792a | [
"MIT"
] | 27 | 2020-09-18T04:12:03.000Z | 2022-03-30T04:22:42.000Z | #!/usr/bin/env python3
import glob
import re
import subprocess
import collections
import argparse
def gen(wildcard, outpath, urlbase):
dd = sorted(glob.glob(wildcard))
print("Found {:} files by '{}'".format(len(dd), wildcard))
res = []
for d in dd:
with open(d) as f:
text = f.re... | 28.279412 | 66 | 0.50702 |
import glob
import re
import subprocess
import collections
import argparse
def gen(wildcard, outpath, urlbase):
dd = sorted(glob.glob(wildcard))
print("Found {:} files by '{}'".format(len(dd), wildcard))
res = []
for d in dd:
with open(d) as f:
text = f.read()
rev = re.... | true | true |
f744d432a9eaa328c38cd7817e1d18db77afc8b2 | 6,454 | py | Python | labs/images/lab5/train_model.py | less-lab-uva/CS4501-Website | 7583e2d800c4450192ea5c22e8e815f6d2ab7edb | [
"MIT"
] | null | null | null | labs/images/lab5/train_model.py | less-lab-uva/CS4501-Website | 7583e2d800c4450192ea5c22e8e815f6d2ab7edb | [
"MIT"
] | null | null | null | labs/images/lab5/train_model.py | less-lab-uva/CS4501-Website | 7583e2d800c4450192ea5c22e8e815f6d2ab7edb | [
"MIT"
] | null | null | null | # Thanks: https://machinelearningmastery.com/how-to-develop-a-cnn-from-scratch-for-fashion-mnist-clothing-classification/
# model with double the filters for the fashion mnist dataset
import cv2
import glob
import argparse
import numpy as np
from numpy import mean
from numpy import std
from numpy import argmax
from m... | 32.59596 | 156 | 0.676945 |
import cv2
import glob
import argparse
import numpy as np
from numpy import mean
from numpy import std
from numpy import argmax
from matplotlib import pyplot
from sklearn.model_selection import KFold
from keras.optimizers import Adam
from keras.callbacks import EarlyStopping
from keras.models import Sequential
from... | true | true |
f744d5701c6a3524e2dd5096fc03113886612553 | 4,902 | py | Python | celery-admin/celery_admin/celery.py | martinlevesque/cronrobot | 0d42ea9be8f2f9563d1c2fb1bac4847c96950ffd | [
"MIT"
] | 5 | 2021-08-23T00:58:39.000Z | 2021-10-07T17:00:45.000Z | celery-admin/celery_admin/celery.py | cronrobot/cronrobot | 0d42ea9be8f2f9563d1c2fb1bac4847c96950ffd | [
"MIT"
] | 103 | 2021-08-12T23:49:54.000Z | 2021-10-19T01:58:04.000Z | celery-admin/celery_admin/celery.py | martinlevesque/cronrobot | 0d42ea9be8f2f9563d1c2fb1bac4847c96950ffd | [
"MIT"
] | null | null | null | import os
import json
import time
import copy
import traceback
import requests
from functools import wraps
import chevron
from celery import Celery
from celery.utils.log import get_task_logger
from .celery_tasks import http as http_task
from .celery_tasks import socket_ping as socket_ping_task
from .celery_tasks imp... | 24.883249 | 110 | 0.655447 | import os
import json
import time
import copy
import traceback
import requests
from functools import wraps
import chevron
from celery import Celery
from celery.utils.log import get_task_logger
from .celery_tasks import http as http_task
from .celery_tasks import socket_ping as socket_ping_task
from .celery_tasks imp... | true | true |
f744d5f8ee54c501ca46f3684294f970f0d0b5e1 | 2,936 | py | Python | lightly/openapi_generated/swagger_client/models/datasource_config_local.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | 1 | 2022-03-10T00:22:30.000Z | 2022-03-10T00:22:30.000Z | lightly/openapi_generated/swagger_client/models/datasource_config_local.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | null | null | null | lightly/openapi_generated/swagger_client/models/datasource_config_local.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 30.583333 | 220 | 0.586512 |
import pprint
import re
import six
from lightly.openapi_generated.swagger_client.configuration import Configuration
class DatasourceConfigLOCAL(object):
swagger_types = {
}
attribute_map = {
}
def __init__(self, _configuration=None):
if _configuration is None:
_con... | true | true |
f744d673fc63cb61874868383ba1e88cd804aa1b | 15,663 | py | Python | tests/test_scopes.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-09-25T04:53:29.000Z | 2020-09-25T04:53:29.000Z | tests/test_scopes.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2018-03-14T19:40:42.000Z | 2020-09-08T16:36:45.000Z | tests/test_scopes.py | grnspace/django-oauth-toolkit | 3d876563a2528eadac0f832f360a0b269b99b94e | [
"BSD-2-Clause-FreeBSD"
] | 7 | 2018-03-07T14:02:15.000Z | 2020-08-13T10:15:37.000Z | import json
from urllib.parse import parse_qs, urlparse
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.test import RequestFactory, TestCase
from django.urls import reverse
from oauth2_provider.models import (
get_access_token_model, get_applicati... | 38.01699 | 110 | 0.645343 | import json
from urllib.parse import parse_qs, urlparse
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.test import RequestFactory, TestCase
from django.urls import reverse
from oauth2_provider.models import (
get_access_token_model, get_applicati... | true | true |
f744d88dc463f49464a7ea6ecacce965b56dc694 | 3,019 | py | Python | launch_ros/launch_ros/parameters_type.py | christophebedard/launch_ros | 4192b02af65cb3a8693cc644952f66b71bfbaa8b | [
"Apache-2.0"
] | 28 | 2019-03-22T17:46:10.000Z | 2022-02-03T10:52:31.000Z | launch_ros/launch_ros/parameters_type.py | christophebedard/launch_ros | 4192b02af65cb3a8693cc644952f66b71bfbaa8b | [
"Apache-2.0"
] | 260 | 2019-03-21T21:24:45.000Z | 2022-03-31T15:36:14.000Z | launch_ros/launch_ros/parameters_type.py | christophebedard/launch_ros | 4192b02af65cb3a8693cc644952f66b71bfbaa8b | [
"Apache-2.0"
] | 58 | 2019-03-28T01:01:57.000Z | 2022-03-31T15:30:55.000Z | # Copyright 2019 Open Source Robotics Foundation, 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... | 36.373494 | 95 | 0.809208 |
import pathlib
from typing import Any
from typing import Dict
from typing import Mapping
from typing import Sequence
from typing import Union
from launch.some_substitutions_type import SomeSubstitutionsType
from launch.some_substitutions_type import SomeSubstitutionsType_types_tuple
from launch.substit... | true | true |
f744d8a4dbb9379d9a15b5c7998642bb890338fe | 4,232 | py | Python | test.py | absperf/expiringsqlitedict | 9091d0b4e5ca25b7e2f110c40d4ec42828ef34f4 | [
"Apache-2.0"
] | 1 | 2020-05-06T09:38:44.000Z | 2020-05-06T09:38:44.000Z | test.py | absperf/expiringsqlitedict | 9091d0b4e5ca25b7e2f110c40d4ec42828ef34f4 | [
"Apache-2.0"
] | null | null | null | test.py | absperf/expiringsqlitedict | 9091d0b4e5ca25b7e2f110c40d4ec42828ef34f4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2021 Taylor C. Richberger
# This code is released under the license described in the LICENSE file
import unittest
from datetime import timedelta
from tempfile import TemporaryDirectory
import time
from pathlib import Path
from expiringsqlitedict import Sqlit... | 37.451327 | 90 | 0.551749 |
import unittest
from datetime import timedelta
from tempfile import TemporaryDirectory
import time
from pathlib import Path
from expiringsqlitedict import SqliteDict, AutocommitSqliteDict
from typing import Any
import json
class JsonSerializer:
@staticmethod
def loads(data: bytes) -> Any:
return j... | true | true |
f744d8bfa48892e1d9c0167a094f8c6b65361c6d | 252 | py | Python | code/tools/pattern_mining/config_pattern_mining.py | go-jugo/ml_failure_prediction | de234a6e9381f05a5979c8600e2f3ad5a98a8670 | [
"Apache-2.0"
] | null | null | null | code/tools/pattern_mining/config_pattern_mining.py | go-jugo/ml_failure_prediction | de234a6e9381f05a5979c8600e2f3ad5a98a8670 | [
"Apache-2.0"
] | null | null | null | code/tools/pattern_mining/config_pattern_mining.py | go-jugo/ml_failure_prediction | de234a6e9381f05a5979c8600e2f3ad5a98a8670 | [
"Apache-2.0"
] | null | null | null | config_pattern_mining = {
'target_col':'components.cont.conditions.logic.errorCode',
'min_gap_since_last_error':1000,
'min_obs_since_last_error':10,
'window_len':1000,
'cross_component':True,
'support':0.5,
'confidence':0.5} | 31.5 | 62 | 0.702381 | config_pattern_mining = {
'target_col':'components.cont.conditions.logic.errorCode',
'min_gap_since_last_error':1000,
'min_obs_since_last_error':10,
'window_len':1000,
'cross_component':True,
'support':0.5,
'confidence':0.5} | true | true |
f744d8c6fce273fda974efe3aa673822805736b5 | 953 | py | Python | astroquery/tests/test_import.py | mdboom/astroquery | 6dac580bf162227a7f7c0d52ba2db2db78ae1a0f | [
"BSD-3-Clause"
] | null | null | null | astroquery/tests/test_import.py | mdboom/astroquery | 6dac580bf162227a7f7c0d52ba2db2db78ae1a0f | [
"BSD-3-Clause"
] | null | null | null | astroquery/tests/test_import.py | mdboom/astroquery | 6dac580bf162227a7f7c0d52ba2db2db78ae1a0f | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function
from distutils.version import LooseVersion
# first test occurs with astropy import locally
def test_monkeypatch_warning(recwarn):
import astropy
if LooseVersion(astropy.version.version) < LooseVersion('0.3.de... | 43.318182 | 284 | 0.739769 |
from __future__ import print_function
from distutils.version import LooseVersion
def test_monkeypatch_warning(recwarn):
import astropy
if LooseVersion(astropy.version.version) < LooseVersion('0.3.dev4957'):
warnstr = "WARNING: You are using an 'old' version of astropy prior to the change that made a... | true | true |
f744da3d6c89662436f770e18ea049b80fc631c1 | 2,709 | py | Python | src/pub_pose.py | TescaF/point_cloud_io | a5848d48f341b88b43f6b28b88d8b048eeefcf8a | [
"BSD-3-Clause"
] | null | null | null | src/pub_pose.py | TescaF/point_cloud_io | a5848d48f341b88b43f6b28b88d8b048eeefcf8a | [
"BSD-3-Clause"
] | null | null | null | src/pub_pose.py | TescaF/point_cloud_io | a5848d48f341b88b43f6b28b88d8b048eeefcf8a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion
import numpy as np
import math
def publish():
pub = rospy.Publisher('pose_truth', PoseStamped, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10)... | 35.181818 | 105 | 0.641934 |
import rospy
from std_msgs.msg import String
from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion
import numpy as np
import math
def publish():
pub = rospy.Publisher('pose_truth', PoseStamped, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10)
... | true | true |
f744da7d5a0741ee8dd8ef22eee87c909cd333e6 | 9,966 | py | Python | dev/prepare_release_issue.py | fernandobugni/airflow | bc76126a9f6172a360fd4301eeb82372d000f70a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2020-12-25T04:09:44.000Z | 2021-04-02T13:37:42.000Z | dev/prepare_release_issue.py | fernandobugni/airflow | bc76126a9f6172a360fd4301eeb82372d000f70a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2022-02-28T04:39:50.000Z | 2022-02-28T04:39:50.000Z | dev/prepare_release_issue.py | fernandobugni/airflow | bc76126a9f6172a360fd4301eeb82372d000f70a | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-23T22:09:17.000Z | 2020-12-23T22:09:17.000Z | #!/usr/bin/env python3
# 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
# "L... | 34.013652 | 108 | 0.655428 |
import logging
import os
import re
import subprocess
import textwrap
from collections import defaultdict
from typing import Any, Dict, List, NamedTuple, Optional, Set
import click
from github import Github, Issue, PullRequest, UnknownObjectException
from rich.console import Console
from rich.progress... | true | true |
f744dc8de5112633e1626d139ae4f553f1754d50 | 1,096 | py | Python | app/tests/conftest.py | isayakhov/duty-schedule-bot | 2515fe8e1ba71b183c31363d99d1c8f1d552826a | [
"MIT"
] | 6 | 2021-01-30T11:31:46.000Z | 2022-02-15T10:09:07.000Z | app/tests/conftest.py | isayakhov/duty-schedule-bot | 2515fe8e1ba71b183c31363d99d1c8f1d552826a | [
"MIT"
] | 2 | 2021-02-04T19:45:07.000Z | 2021-02-05T12:23:56.000Z | app/tests/conftest.py | isayakhov/duty-schedule-bot | 2515fe8e1ba71b183c31363d99d1c8f1d552826a | [
"MIT"
] | 2 | 2022-02-06T11:22:30.000Z | 2022-02-06T18:46:14.000Z | # pylint: disable=redefined-outer-name
from unittest import mock
import pytest
from fastapi.testclient import TestClient
from app.common import cache
@pytest.fixture(autouse=True, scope="function")
def clear_cache():
# pylint: disable=protected-access
cache._redis_cli.flushall() # noqa
@pytest.fixture
d... | 19.571429 | 108 | 0.741788 |
from unittest import mock
import pytest
from fastapi.testclient import TestClient
from app.common import cache
@pytest.fixture(autouse=True, scope="function")
def clear_cache():
cache._redis_cli.flushall()
@pytest.fixture
def chat_id(faker):
return faker.pystr()
@pytest.fixture
def username(fak... | true | true |
f744dcd7b39b651d46cb2291d4f1fe36ff0e65e9 | 1,634 | py | Python | utils/cleanup.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | utils/cleanup.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | utils/cleanup.py | j-boivie/fiaas-deploy-daemon | 3bba04b3b329f4c9c1418d80a9a007e8ed22f804 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8
import itertools
import subprocess
import yaml
from k8s import config
from k8s.models.namespace import Namespace
from tqdm import tqdm
from fiaas_deploy_daemon.tpr.types import PaasbetaStatus
"""Requires `tqdm`, which is not usually part of our requirements."""
def _config... | 27.233333 | 79 | 0.681151 |
import itertools
import subprocess
import yaml
from k8s import config
from k8s.models.namespace import Namespace
from tqdm import tqdm
from fiaas_deploy_daemon.tpr.types import PaasbetaStatus
def _configure():
output = subprocess.check_output(["kubectl", "config", "view", "--minify"])
kube = yaml.safe_lo... | true | true |
f744dd039cf2263371bd9c1d490b7ba055643bc0 | 1,840 | py | Python | Instagram/urls.py | hlwarun/Instagram-Clone | 276d8076f49bae8de9539c9df542d817a2ca30b4 | [
"Apache-2.0"
] | 3 | 2020-11-12T17:48:27.000Z | 2022-02-03T03:40:50.000Z | Instagram/urls.py | hlwarun/Instagram-Clone | 276d8076f49bae8de9539c9df542d817a2ca30b4 | [
"Apache-2.0"
] | null | null | null | Instagram/urls.py | hlwarun/Instagram-Clone | 276d8076f49bae8de9539c9df542d817a2ca30b4 | [
"Apache-2.0"
] | 1 | 2021-04-27T08:02:02.000Z | 2021-04-27T08:02:02.000Z | """Instagram URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 44.878049 | 174 | 0.738043 | from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('post.urls')),
path('user/', include('use... | true | true |
f744dd49f512bd1725a65273822a7962167e7424 | 15,911 | py | Python | parametric_plasma_source/source.py | teade/parametric-plasma-source | 206e4d2529e77d0b92f15b7f91b85bdf0cef34a7 | [
"MIT"
] | null | null | null | parametric_plasma_source/source.py | teade/parametric-plasma-source | 206e4d2529e77d0b92f15b7f91b85bdf0cef34a7 | [
"MIT"
] | null | null | null | parametric_plasma_source/source.py | teade/parametric-plasma-source | 206e4d2529e77d0b92f15b7f91b85bdf0cef34a7 | [
"MIT"
] | null | null | null | """
Auto-generated file. To edit, run `python build_python.py`.
This will need to be run whenever a new C++ version is made available.
"""
source_sampling_cpp = (
"""#include <iostream>
#include "openmc/random_lcg.h"
#include "openmc/source.h"
#include "openmc/particle.h"
#include "plasma_source.hpp"
// Spherical to... | 28.012324 | 100 | 0.671611 |
source_sampling_cpp = (
"""#include <iostream>
#include "openmc/random_lcg.h"
#include "openmc/source.h"
#include "openmc/particle.h"
#include "plasma_source.hpp"
// Spherical tokamak SOURCE
// units are in SI units
const double ion_density_pedistal = 1.09e+20; // ions per m^3
const double ion_density_seperatrix = ... | true | true |
f744dda1309099d4d71b65e2196a9f5bd3f4a92d | 40,683 | py | Python | src/quo/document.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 5 | 2021-06-17T21:06:39.000Z | 2022-03-11T06:45:51.000Z | src/quo/document.py | chouette254/quo | 8979afd118e77d3d0f93f9fbe8711efada7158c5 | [
"MIT"
] | 39 | 2021-07-19T19:36:18.000Z | 2022-02-23T14:55:08.000Z | src/quo/document.py | secretuminc/quo | c4f77d52f015c612d32ed0fc2fc79545af598f10 | [
"MIT"
] | 1 | 2021-05-31T17:19:15.000Z | 2021-05-31T17:19:15.000Z | """
The `Document` that implements all the text operations/querying.
"""
import bisect
import re
import string
import weakref
from typing import (
Callable,
Iterable,
List,
NoReturn,
Optional,
Pattern,
Tuple,
cast,
)
from quo.clipboard import Data
from quo.filters import vi_mode
from .s... | 34.130034 | 88 | 0.581816 | import bisect
import re
import string
import weakref
from typing import (
Callable,
Iterable,
List,
NoReturn,
Optional,
Pattern,
Tuple,
cast,
)
from quo.clipboard import Data
from quo.filters import vi_mode
from .selection import PasteMode, SelectionState, SelectionType
__all__ = [
... | true | true |
f744ddccf5fb18a734d90b76873e09d94c88255d | 13,450 | py | Python | peartree/paths.py | d3netxer/peartree | 577b077c169c7f102d5947b5f9f273fc965eb41f | [
"MIT"
] | null | null | null | peartree/paths.py | d3netxer/peartree | 577b077c169c7f102d5947b5f9f273fc965eb41f | [
"MIT"
] | null | null | null | peartree/paths.py | d3netxer/peartree | 577b077c169c7f102d5947b5f9f273fc965eb41f | [
"MIT"
] | null | null | null | from typing import Any, Dict, List
import networkx as nx
import numpy as np
import partridge as ptg
from .graph import (generate_empty_md_graph, generate_summary_graph_elements,
make_synthetic_system_network, populate_graph)
from .synthetic import SyntheticTransitNetwork
from .toolkit import gener... | 41.384615 | 79 | 0.658885 | from typing import Any, Dict, List
import networkx as nx
import numpy as np
import partridge as ptg
from .graph import (generate_empty_md_graph, generate_summary_graph_elements,
make_synthetic_system_network, populate_graph)
from .synthetic import SyntheticTransitNetwork
from .toolkit import gener... | true | true |
f744df937b95504efbeb94b4dc3cf8a974204327 | 1,684 | py | Python | _examples/structs/test.py | cosnicolaou/gopy | 87be7f7b22c3c65e506e4d028feb9945422ced73 | [
"BSD-3-Clause"
] | null | null | null | _examples/structs/test.py | cosnicolaou/gopy | 87be7f7b22c3c65e506e4d028feb9945422ced73 | [
"BSD-3-Clause"
] | null | null | null | _examples/structs/test.py | cosnicolaou/gopy | 87be7f7b22c3c65e506e4d028feb9945422ced73 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
## py2/py3 compat
from __future__ import print_function
import structs
print("s = structs.S()")
s = structs.S()
print("s = %s" % (s,))
print("s.Init()")
... | 23.068493 | 63 | 0.586105 |
import print_function
import structs
print("s = structs.S()")
s = structs.S()
print("s = %s" % (s,))
print("s.Init()")
s.Init()
print("s.Upper('boo')= %s" % repr(s.Upper("boo")).lstrip('u'))
print("s1 = structs.S1()")
s1 = structs.S1()
print("s1 = %s" %(s1,))
try:
s1 = structs.S1(1)
except Exception as err... | true | true |
f744e2a514d22ab54acf2609afe7cb68d6342053 | 168 | py | Python | Py11/main.py | xhexe/Py8R | 44238c5403e7f76988760a040bf5c292824c22e7 | [
"WTFPL"
] | null | null | null | Py11/main.py | xhexe/Py8R | 44238c5403e7f76988760a040bf5c292824c22e7 | [
"WTFPL"
] | null | null | null | Py11/main.py | xhexe/Py8R | 44238c5403e7f76988760a040bf5c292824c22e7 | [
"WTFPL"
] | null | null | null | def sum(x, y, z):
if x == y == z:
calc = 0
else:
calc = x + y + z
return calc
print(sum(1, 1, 1))
print(sum(1, 3, 3))
print(sum(3, 1, 3))
| 14 | 24 | 0.434524 | def sum(x, y, z):
if x == y == z:
calc = 0
else:
calc = x + y + z
return calc
print(sum(1, 1, 1))
print(sum(1, 3, 3))
print(sum(3, 1, 3))
| true | true |
f744e2c999b32c4a4cf90b0ccb70358ab288dd10 | 3,219 | py | Python | python/birdVid_ML/JetsonYolo.py | plertvilai/birdCam_jetson | 8e74bbc81c289b3e0158edbd471fda0f3ed2b9fb | [
"MIT"
] | null | null | null | python/birdVid_ML/JetsonYolo.py | plertvilai/birdCam_jetson | 8e74bbc81c289b3e0158edbd471fda0f3ed2b9fb | [
"MIT"
] | null | null | null | python/birdVid_ML/JetsonYolo.py | plertvilai/birdCam_jetson | 8e74bbc81c289b3e0158edbd471fda0f3ed2b9fb | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from elements.yolo import OBJ_DETECTION
Object_classes = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
... | 40.746835 | 138 | 0.571295 | import cv2
import numpy as np
from elements.yolo import OBJ_DETECTION
Object_classes = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
... | true | true |
f744e30dfb2ab1b6b5818c3366a686712d80e47a | 7,229 | py | Python | db_template.py | XENONnT/moderator | 693286dad325396d882bcced0fd47265959deb9d | [
"BSD-2-Clause"
] | null | null | null | db_template.py | XENONnT/moderator | 693286dad325396d882bcced0fd47265959deb9d | [
"BSD-2-Clause"
] | null | null | null | db_template.py | XENONnT/moderator | 693286dad325396d882bcced0fd47265959deb9d | [
"BSD-2-Clause"
] | null | null | null | #Author: Boris Bauermeister
#Email: Boris.Bauermeister@gmail.com
#Simple MongoDB access class specified to readout and manipluate a data field.
#HANDLE WITH CARE
import pymongo
import os
import json
class DBManager():
def __init__(self):
self.db_mongodb_user=None
self.db_mongodb_pw=None
se... | 37.651042 | 128 | 0.513487 |
import pymongo
import os
import json
class DBManager():
def __init__(self):
self.db_mongodb_user=None
self.db_mongodb_pw=None
self.taddress=None
self.db_extern = None
self.db_projection = {"_id":True, "data": True, "name": True, "number":True, "start":True, 'detector': ... | true | true |
f744e33e63fb8e9d203257b688e911f5d53e72b2 | 755 | py | Python | setup.py | lancelee82/pynccl | 2a2868a9cf9396f6ca70511de6a2f834124d3c7c | [
"MIT"
] | 2 | 2021-01-21T17:30:57.000Z | 2022-02-12T15:34:28.000Z | setup.py | lancelee82/pynccl | 2a2868a9cf9396f6ca70511de6a2f834124d3c7c | [
"MIT"
] | null | null | null | setup.py | lancelee82/pynccl | 2a2868a9cf9396f6ca70511de6a2f834124d3c7c | [
"MIT"
] | null | null | null | import setuptools
packages = [
'pynccl',
'pynccl.utils',
]
setuptools.setup(
name='pynccl',
version='0.1.2',
author="Lance Lee",
author_email="lancelee82@163.com",
description="pynccl - python bindings for NVIDIA NCCL libraries",
long_description=open("README.md").read(),
long_des... | 25.166667 | 71 | 0.629139 | import setuptools
packages = [
'pynccl',
'pynccl.utils',
]
setuptools.setup(
name='pynccl',
version='0.1.2',
author="Lance Lee",
author_email="lancelee82@163.com",
description="pynccl - python bindings for NVIDIA NCCL libraries",
long_description=open("README.md").read(),
long_des... | true | true |
f744e38df1639b14725933d9a334fa75c86a9238 | 53,395 | py | Python | React/search-card-app-react/.yarn/unplugged/node-gyp-npm-8.1.0-30cf500e19/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | saanyalall/Hacktoberfest2021-2 | 3b9aea4ff320976e7c2bcb85f5265be87b0c33be | [
"MIT"
] | 11 | 2018-12-09T22:47:16.000Z | 2021-04-19T13:30:07.000Z | React/search-card-app-react/.yarn/unplugged/node-gyp-npm-8.1.0-30cf500e19/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | saanyalall/Hacktoberfest2021-2 | 3b9aea4ff320976e7c2bcb85f5265be87b0c33be | [
"MIT"
] | 41 | 2021-07-16T14:11:20.000Z | 2022-03-21T01:55:22.000Z | React/search-card-app-react/.yarn/unplugged/node-gyp-npm-8.1.0-30cf500e19/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | saanyalall/Hacktoberfest2021-2 | 3b9aea4ff320976e7c2bcb85f5265be87b0c33be | [
"MIT"
] | 2 | 2019-04-26T19:40:20.000Z | 2020-04-23T12:57:49.000Z | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | 42.545817 | 88 | 0.614908 |
import os
import re
import subprocess
import sys
from gyp.common import OrderedSet
import gyp.MSVSUtil
import gyp.MSVSVersion
windows_quoter_regex = re.compile(r'(\\*)"')
def QuoteForRspFile(arg):
# See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment
# threads. This is actually the qu... | true | true |
f744e3c66f67d387ec9de31d530303558774ff15 | 6,418 | py | Python | converter/records.py | michaelkariv/firestore-export-json | 78cfaaf086592d326daf0ffdd93ceeda5fb52b1f | [
"MIT"
] | 28 | 2021-04-27T03:11:19.000Z | 2022-03-21T09:05:27.000Z | converter/records.py | michaelkariv/firestore-export-json | 78cfaaf086592d326daf0ffdd93ceeda5fb52b1f | [
"MIT"
] | 6 | 2021-05-26T10:10:11.000Z | 2022-02-14T07:59:31.000Z | converter/records.py | michaelkariv/firestore-export-json | 78cfaaf086592d326daf0ffdd93ceeda5fb52b1f | [
"MIT"
] | 10 | 2021-05-18T05:48:41.000Z | 2022-02-14T18:51:53.000Z | import logging
import struct
import google_crc32c
# Data format is defined @ https://github.com/google/leveldb/blob/master/doc/log_format.md
ENDIANNESS = "little"
CRC_INIT = 0
BLOCK_SIZE = 32 * 1024
HEADER_FORMAT = "<IHB"
HEADER_LENGTH = struct.calcsize(HEADER_FORMAT)
# the type is the "B" part of the HEADER_FO... | 31.004831 | 90 | 0.539109 | import logging
import struct
import google_crc32c
ENDIANNESS = "little"
CRC_INIT = 0
BLOCK_SIZE = 32 * 1024
HEADER_FORMAT = "<IHB"
HEADER_LENGTH = struct.calcsize(HEADER_FORMAT)
RECORD_TYPE_LENGTH = struct.calcsize("<B")
RECORD_TYPE_NONE = 0
RECORD_TYPE_FULL = 1
RECORD_TYPE_FIRST = 2
RECORD_TYPE_MIDDLE = ... | true | true |
f744e487c59a44a69263b1b09a858a11ae37dd7c | 82,638 | py | Python | test/runtest.py | andyljones/ray | 52dfde1cbb7131fd62ebcb00f5a2b22ced7321ad | [
"Apache-2.0"
] | null | null | null | test/runtest.py | andyljones/ray | 52dfde1cbb7131fd62ebcb00f5a2b22ced7321ad | [
"Apache-2.0"
] | null | null | null | test/runtest.py | andyljones/ray | 52dfde1cbb7131fd62ebcb00f5a2b22ced7321ad | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import random
import re
import setproctitle
import shutil
import socket
import string
import subprocess
import sys
import tempfile
import threading
import time
from collecti... | 30.104918 | 79 | 0.612491 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import random
import re
import setproctitle
import shutil
import socket
import string
import subprocess
import sys
import tempfile
import threading
import time
from collecti... | true | true |
f744e4b5c7b491231658968c5f8430cd814185c4 | 325 | py | Python | calculation/config/docs.py | tthmatt/erpnext_cal | b6a45da19a77b6b5d79a0117644daf299009ff0f | [
"MIT"
] | 1 | 2020-06-14T20:20:14.000Z | 2020-06-14T20:20:14.000Z | calculation/config/docs.py | riconova92/calculation | a5bdafdd064a44639fb4a400c7f4eaec94db32b4 | [
"MIT"
] | null | null | null | calculation/config/docs.py | riconova92/calculation | a5bdafdd064a44639fb4a400c7f4eaec94db32b4 | [
"MIT"
] | 1 | 2020-06-14T20:15:22.000Z | 2020-06-14T20:15:22.000Z | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/calculation"
# docs_base_url = "https://[org_name].github.io/calculation"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Calculat... | 27.083333 | 68 | 0.732308 |
def get_context(context):
context.brand_html = "Calculation"
| true | true |
f744e57e4a2444a8a36373df170fea266281290d | 2,846 | py | Python | ALS-Model-preparation.py | Chris642/ALS-Model-serving-on-Kubeflow | 52aa935e6948a1af477e71f1ec2808925c635662 | [
"MIT"
] | null | null | null | ALS-Model-preparation.py | Chris642/ALS-Model-serving-on-Kubeflow | 52aa935e6948a1af477e71f1ec2808925c635662 | [
"MIT"
] | null | null | null | ALS-Model-preparation.py | Chris642/ALS-Model-serving-on-Kubeflow | 52aa935e6948a1af477e71f1ec2808925c635662 | [
"MIT"
] | 1 | 2020-06-27T07:17:34.000Z | 2020-06-27T07:17:34.000Z |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not u... | 38.986301 | 96 | 0.695011 |
from __future__ import print_function
import sys
if sys.version >= '3':
long = int
from pyspark.sql import SparkSession
import numpy as np
from pyspark.ml.evaluation import RegressionEvaluator
from pyspark.ml.recommendation import ALS
from pyspark.sql import Row
import pickle
if __name__ == "... | true | true |
f744e601887fe4f0882d9930534c4842aa255fac | 2,533 | py | Python | imagepypelines/core/Data.py | jmaggio14/jefftools | e429834d84623e20b4bb1f965949242528ffc7b3 | [
"Apache-2.0"
] | 3 | 2018-12-05T02:41:45.000Z | 2019-06-01T02:33:09.000Z | imagepypelines/core/Data.py | jmaggio14/jefftools | e429834d84623e20b4bb1f965949242528ffc7b3 | [
"Apache-2.0"
] | 69 | 2018-12-12T03:37:38.000Z | 2020-10-25T15:22:31.000Z | imagepypelines/core/Data.py | jmaggio14/jefftools | e429834d84623e20b4bb1f965949242528ffc7b3 | [
"Apache-2.0"
] | 1 | 2018-08-13T20:45:02.000Z | 2018-08-13T20:45:02.000Z | # @Email: jmaggio14@gmail.com
# @Website: https://www.imagepypelines.org/
# @License: https://github.com/jmaggio14/imagepypelines/blob/master/LICENSE
# @github: https://github.com/jmaggio14/imagepypelines
#
# Copyright (c) 2018-2020 Jeff Maggio, Ryan Hartzell, and collaborators
#
import numpy as np
class Data(object)... | 32.896104 | 82 | 0.417687 |
import numpy as np
class Data(object):
def __init__(self, data):
self.data = data
| true | true |
f744e60c82f0e3da3bc951df7b4694ea0413c3ce | 3,574 | bzl | Python | bazel/envoy_binary.bzl | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | 1 | 2022-02-15T23:04:31.000Z | 2022-02-15T23:04:31.000Z | bazel/envoy_binary.bzl | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | 86 | 2021-10-04T18:29:31.000Z | 2022-03-31T18:18:05.000Z | bazel/envoy_binary.bzl | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | null | null | null | load("@rules_cc//cc:defs.bzl", "cc_binary")
# DO NOT LOAD THIS FILE. Load envoy_build_system.bzl instead.
# Envoy binary targets
load(
":envoy_internal.bzl",
"envoy_copts",
"envoy_external_dep_path",
"envoy_stdlib_deps",
"tcmalloc_external_dep",
)
# Envoy C++ binary targets should be specified wit... | 30.288136 | 95 | 0.553162 | load("@rules_cc//cc:defs.bzl", "cc_binary")
load(
":envoy_internal.bzl",
"envoy_copts",
"envoy_external_dep_path",
"envoy_stdlib_deps",
"tcmalloc_external_dep",
)
def envoy_cc_binary(
name,
srcs = [],
data = [],
testonly = 0,
visibility = None,
ex... | true | true |
f744e74ff7b7010d24f72f11be9239a2ac053811 | 1,735 | py | Python | prostate_cancer_segmentation/config_parse/callbacks_available.py | vpeopleonatank/pytorch_lightning_segmentation_template | 4637062d9de840714b2914583c51c4694646a6ab | [
"Apache-2.0"
] | 1 | 2021-02-23T15:37:22.000Z | 2021-02-23T15:37:22.000Z | prostate_cancer_segmentation/config_parse/callbacks_available.py | vpeopleonatank/pytorch_lightning_segmentation_template | 4637062d9de840714b2914583c51c4694646a6ab | [
"Apache-2.0"
] | null | null | null | prostate_cancer_segmentation/config_parse/callbacks_available.py | vpeopleonatank/pytorch_lightning_segmentation_template | 4637062d9de840714b2914583c51c4694646a6ab | [
"Apache-2.0"
] | null | null | null | """Dataclasses just to initialize and return Callback objects"""
from typing import Optional, TYPE_CHECKING
from omegaconf import DictConfig
from dataclasses import dataclass
from pytorch_lightning.callbacks import Callback, EarlyStopping, LearningRateMonitor, ModelCheckpoint
from prostate_cancer_segmentation.callbac... | 27.539683 | 101 | 0.758501 | from typing import Optional, TYPE_CHECKING
from omegaconf import DictConfig
from dataclasses import dataclass
from pytorch_lightning.callbacks import Callback, EarlyStopping, LearningRateMonitor, ModelCheckpoint
from prostate_cancer_segmentation.callbacks.log_media import LogMedia
from prostate_cancer_segmentation.co... | true | true |
f744eab37255a2c107b742711d5d7033e1ff8193 | 22,378 | py | Python | vumi/transports/smpp/protocol.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 199 | 2015-01-05T09:04:24.000Z | 2018-08-15T17:02:49.000Z | vumi/transports/smpp/protocol.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 187 | 2015-01-06T15:22:38.000Z | 2018-07-14T13:15:29.000Z | vumi/transports/smpp/protocol.py | seidu626/vumi | 62eae205a07029bc7ab382086715694548001876 | [
"BSD-3-Clause"
] | 86 | 2015-01-31T02:47:08.000Z | 2018-12-01T11:59:47.000Z | # -*- test-case-name: vumi.transports.smpp.tests.test_protocol -*-
from functools import wraps
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.internet.task import LoopingCall
from twisted.internet.defer import (
inlineCallbacks, returnValue, maybeDeferred, DeferredQueue, succeed)
from... | 37.421405 | 79 | 0.622531 |
from functools import wraps
from twisted.internet.protocol import Protocol, ClientFactory
from twisted.internet.task import LoopingCall
from twisted.internet.defer import (
inlineCallbacks, returnValue, maybeDeferred, DeferredQueue, succeed)
from smpp.pdu import unpack_pdu
from smpp.pdu_builder import (
Bin... | true | true |
f744eaee15bd9d26f23802777416cc1d4d4081b4 | 2,001 | py | Python | azext_iot/sdk/digitaltwins/controlplane/models/digital_twins_identity_py3.py | v-andreaco/azure-iot-cli-extension | 18b20b0a6ba9f75556979eb905e6d2271eb27ddd | [
"MIT"
] | null | null | null | azext_iot/sdk/digitaltwins/controlplane/models/digital_twins_identity_py3.py | v-andreaco/azure-iot-cli-extension | 18b20b0a6ba9f75556979eb905e6d2271eb27ddd | [
"MIT"
] | null | null | null | azext_iot/sdk/digitaltwins/controlplane/models/digital_twins_identity_py3.py | v-andreaco/azure-iot-cli-extension | 18b20b0a6ba9f75556979eb905e6d2271eb27ddd | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.480769 | 79 | 0.636682 |
from msrest.serialization import Model
class DigitalTwinsIdentity(Model):
_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'principal_id': {'key': 'principalId', 't... | true | true |
f744eaf306c38610009118b00b1a70801415d0c8 | 1,239 | py | Python | motor_descuento/modelo/modelo_geolocalizacion.py | angelquin1986/tiptopDescuentos | 6bca61d3142b75eee0e72f3932aeabcf1457526a | [
"Apache-2.0"
] | null | null | null | motor_descuento/modelo/modelo_geolocalizacion.py | angelquin1986/tiptopDescuentos | 6bca61d3142b75eee0e72f3932aeabcf1457526a | [
"Apache-2.0"
] | 4 | 2021-03-30T13:51:49.000Z | 2021-09-22T19:15:28.000Z | motor_descuento/modelo/modelo_geolocalizacion.py | angelquin1986/tiptopDescuentos | 6bca61d3142b75eee0e72f3932aeabcf1457526a | [
"Apache-2.0"
] | null | null | null | from django.db import models
"""
@Author Aquingaluisa
Modelos de tipti para localizacion geografica
"""
class Country(models.Model):
name = models.CharField(max_length=50)
codigo = models.CharField(max_length=50)
lenguaje = models.CharField(max_length=50)
currency = models.CharField(max_length=50)
... | 23.826923 | 68 | 0.705408 | from django.db import models
class Country(models.Model):
name = models.CharField(max_length=50)
codigo = models.CharField(max_length=50)
lenguaje = models.CharField(max_length=50)
currency = models.CharField(max_length=50)
class Meta:
db_table = 'country'
class Province(models.Model):... | true | true |
f744ebdf0f797208a94944ada7ce2271fb7ee8d2 | 5,514 | py | Python | contrib/seeds/makeseeds.py | GrowCoin-Project/GROW | 1a7bff93d6e0d65b4f5e2629bb7e034dd6b9c228 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | GrowCoin-Project/GROW | 1a7bff93d6e0d65b4f5e2629bb7e034dd6b9c228 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | GrowCoin-Project/GROW | 1a7bff93d6e0d65b4f5e2629bb7e034dd6b9c228 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
#... | 32.05814 | 186 | 0.566921 |
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
""
}
import re
import sys
import dns.resolver
import collections
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})... | true | true |
f744ebe4c91cf6dcc9df612552c69e155d1d600b | 1,011 | py | Python | RoughWork/stddev.py | SimonMcLain/Project_Repository_Programming_and_Scripting_2018 | c10769973461d4c30b2c0a9d3a1f0e812049ca44 | [
"Apache-2.0"
] | null | null | null | RoughWork/stddev.py | SimonMcLain/Project_Repository_Programming_and_Scripting_2018 | c10769973461d4c30b2c0a9d3a1f0e812049ca44 | [
"Apache-2.0"
] | null | null | null | RoughWork/stddev.py | SimonMcLain/Project_Repository_Programming_and_Scripting_2018 | c10769973461d4c30b2c0a9d3a1f0e812049ca44 | [
"Apache-2.0"
] | null | null | null | #Simon McLain 2018-04-25
# Experimenting with numpy
# https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html reference to standard deviation
# calculate the standard deviation of each column
import numpy
#imports numpy library providing math functions to operate on them
data = numpy.genfromtxt('iris.csv... | 42.125 | 102 | 0.735905 |
import numpy
data = numpy.genfromtxt('iris.csv', delimiter=',')
col1 = data[:,0]
stdcol1 = numpy.std(data[:,0])
col2 =data[:, 1]
stdcol2 = numpy.std(data[:, 1])
col3 =data[:, 2]
stdcol3 = numpy.std(data[:, 2])
col4 =data[:, 3]
stdcol4 = numpy.std(data[:, 3])
print("The standard deviation in petal length is: "... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.