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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7038a82901c73f8b97543c9ba73f6bc069364fd | 1,496 | py | Python | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | null | null | null | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | 4 | 2020-02-18T00:17:01.000Z | 2020-03-10T21:17:33.000Z | Code/word_jumbler.py | squeaky1273/CS-1.3-Core-Data-Structures | e4aeabebc757b65dae89b82b2c341b90cf9880b6 | [
"MIT"
] | null | null | null | # Dictionary
class Dict_word_jumbler(object):
def __init__(self):
self.dict = self.build_dict()
def build_dict(self):
""""Build a dictionary to hold all of the words/letters"""
dic = {}
f = open("/usr/share/dict/words", "r")
word_list = f.readlines()
for word in ... | 34.790698 | 87 | 0.580214 |
class Dict_word_jumbler(object):
def __init__(self):
self.dict = self.build_dict()
def build_dict(self):
dic = {}
f = open("/usr/share/dict/words", "r")
word_list = f.readlines()
for word in word_list:
word = word.strip().lower()
words = ''.join(... | true | true |
f7038b41b4f2b57e449c6284c229a0c467b90e25 | 119 | py | Python | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | pickle2.py | himanshuhat21/mcd | 2603f7eb0926e2b47464e6913ea665d5dca6b767 | [
"MIT"
] | null | null | null | import pickle
dict1 = {'Python ':90,'Java ':95,'C++ ':85}
f = open('bin)file.dat','wb')
pickle.dump(dict1,f)
f.close() | 23.8 | 43 | 0.613445 | import pickle
dict1 = {'Python ':90,'Java ':95,'C++ ':85}
f = open('bin)file.dat','wb')
pickle.dump(dict1,f)
f.close() | true | true |
f7038c9082852a874f45dece3844cb48296d142a | 7,393 | py | Python | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | run/run_ResGraphNet.py | czw1296924847/ResGraphNet | 1638236e4138719c324afc3137f31cfec8a9de64 | [
"MIT"
] | null | null | null | """
Testing ResGraphNet
"""
import datetime
import numpy as np
import pandas as pd
import torch
import os
import os.path as osp
import matplotlib.pyplot as plt
import sys
sys.path.append("..")
import func.cal as cal
device = "cuda:0" if torch.cuda.is_available() else "cpu"
# device = "cpu"
l_x = 60 ... | 40.179348 | 126 | 0.685108 | import datetime
import numpy as np
import pandas as pd
import torch
import os
import os.path as osp
import matplotlib.pyplot as plt
import sys
sys.path.append("..")
import func.cal as cal
device = "cuda:0" if torch.cuda.is_available() else "cpu"
l_x = 60
l_y = 1
lr = 0.0001 ... | true | true |
f7038e23fe0fcedf0278b48b1b3477e90f408cec | 8,573 | py | Python | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | idea.py | JaworWr/Dynamic-inverse-kinematics | b9da50b88152682060075a44da940e6f98690a9a | [
"MIT"
] | null | null | null | import numpy as np
def FNS(scores):
domination = np.all(scores[:, None, :] <= scores[None, :, :], axis=2) # domination[i, j] = "i dominuje j"
domination &= np.any(scores[:, None, :] < scores[None, :, :], axis=2)
Nx = domination.sum(0)
Pf = []
ranks = np.zeros(scores.shape[0])
r = 0
Q = n... | 32.973077 | 118 | 0.591508 | import numpy as np
def FNS(scores):
domination = np.all(scores[:, None, :] <= scores[None, :, :], axis=2)
domination &= np.any(scores[:, None, :] < scores[None, :, :], axis=2)
Nx = domination.sum(0)
Pf = []
ranks = np.zeros(scores.shape[0])
r = 0
Q = np.nonzero(Nx == 0)[0]
while Q.s... | true | true |
f7038fc0bc5d2f6096f6475db9c9bcecc2181c6d | 8,118 | py | Python | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | 1 | 2020-09-28T11:34:28.000Z | 2020-09-28T11:34:28.000Z | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | null | null | null | proxy/utils.py | rmarx/quic_iot | 56e3c184bdaa20c065150c33851a5b6608987b8b | [
"MIT"
] | 1 | 2021-04-05T16:19:51.000Z | 2021-04-05T16:19:51.000Z | """
Misc functions.
"""
import ipaddress
import datetime
import hashlib
import json
import netaddr
import netifaces
import os
import re
import requests
import scapy.all as sc
import subprocess
import sys
import threading
import time
import traceback
import uuid
import server_config
IPv4_REGEX = re.compile(r'[0-9]{... | 22.363636 | 91 | 0.615176 | import ipaddress
import datetime
import hashlib
import json
import netaddr
import netifaces
import os
import re
import requests
import scapy.all as sc
import subprocess
import sys
import threading
import time
import traceback
import uuid
import server_config
IPv4_REGEX = re.compile(r'[0-9]{0,3}\.[0-9]{0,3}\.[0-9]{0... | true | true |
f703901192427f703569a7943582237c9e551aeb | 8,622 | py | Python | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 12 | 2021-09-11T16:27:24.000Z | 2021-11-07T12:48:13.000Z | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 1 | 2021-09-11T16:42:02.000Z | 2021-09-12T04:14:04.000Z | py_trans/async_translator.py | Itz-fork/py-trans | 2c35eb987ad990850dab55f00ec0f1c489b2589e | [
"MIT"
] | 2 | 2021-10-03T10:17:31.000Z | 2022-01-25T12:33:45.000Z | # Project: py-trans
# Author: Itz-fork
import aiohttp
from .language_codes import _get_full_lang_name, _get_lang_code
from .errors import check_internet_connection, UnknownErrorOccurred
class Async_PyTranslator:
"""
Async PyTranslator Class
Note:
Before Trying to Translate Create an instance of ... | 47.373626 | 190 | 0.593714 |
import aiohttp
from .language_codes import _get_full_lang_name, _get_lang_code
from .errors import check_internet_connection, UnknownErrorOccurred
class Async_PyTranslator:
def __init__(self, provider="google"):
check_internet_connection()
self.providers = ["google", "libre", "translat... | true | true |
f703904473e73730adab7124ddff717c8c6d6c0d | 14,395 | py | Python | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/api/assets/saved_query.py | Axonius/axonius_api_client | 751fd6346ee9f361a73cd1399704b6d928f130ae | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""API for working with saved queries for assets."""
import warnings
from typing import Generator, List, Optional, Union
from ...constants.api import MAX_PAGE_SIZE
from ...exceptions import NotFoundError, ResponseError, ApiWarning
# from ...features import Features
from ...parsers.tables impor... | 34.93932 | 107 | 0.570823 |
import warnings
from typing import Generator, List, Optional, Union
from ...constants.api import MAX_PAGE_SIZE
from ...exceptions import NotFoundError, ResponseError, ApiWarning
from ...parsers.tables import tablize_sqs
from ...tools import check_gui_page_size, listify
from .. import json_api
from ..api_endpoints i... | true | true |
f703904bca3f1b62c246cc7e14f00f30d95c4d00 | 6,564 | py | Python | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | producer/util.py | Keck-FOBOS/producer | 6f2b0d3f29f62187bf593567081061e53ddb5a4e | [
"BSD-3-Clause"
] | null | null | null | """
Miscellaneous package utilities.
.. include:: ../include/links.rst
"""
from itertools import chain, combinations
from IPython import embed
import numpy
def all_subclasses(cls):
"""
Collect all the subclasses of the provided class.
The search follows the inheritance to the highest-level class. I... | 33.319797 | 104 | 0.61883 |
from itertools import chain, combinations
from IPython import embed
import numpy
def all_subclasses(cls):
return set(cls.__subclasses__()).union(
[s for c in cls.__subclasses__() for s in all_subclasses(c)])
def string_table(tbl, delimeter='print', has_header=True):
nrows, ncols = tbl.shape
... | true | true |
f70390583a82b46fca6f1d21db1f09463d4fd79d | 3,979 | py | Python | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | generate_cdiscount_predictions.py | chundiliu/slim_for_Cdiscount | ea7f9d56072072c031094c12c803c63591066c6c | [
"Apache-2.0"
] | null | null | null | import math
import tensorflow as tf
import os
import struct
import pdb
import numpy as np
from datasets import dataset_factory
from nets import nets_factory
import nets.resnet_v2 as resnet_v2
from preprocessing import preprocessing_factory
slim = tf.contrib.slim
def merge_predictions(predictions_fn):
'''
Merge... | 35.526786 | 121 | 0.654938 | import math
import tensorflow as tf
import os
import struct
import pdb
import numpy as np
from datasets import dataset_factory
from nets import nets_factory
import nets.resnet_v2 as resnet_v2
from preprocessing import preprocessing_factory
slim = tf.contrib.slim
def merge_predictions(predictions_fn):
out_f = open... | true | true |
f703910d9e118fa5006358175ab5d250b7cb827a | 15,716 | py | Python | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | src/collective/solr/browser/maintenance.py | IMIO/collective.solr | 844219eb3968b34d2b83a7bd5f59340d676d149e | [
"ZPL-1.1"
] | null | null | null | # -*- coding: utf-8 -*-
from logging import getLogger
from time import time, strftime
from BTrees.IIBTree import IITreeSet
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.uuid.interfaces import IUUID, IUUIDAware
from zope.interface import implementer
from zope.... | 35.718182 | 88 | 0.53646 |
from logging import getLogger
from time import time, strftime
from BTrees.IIBTree import IITreeSet
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.uuid.interfaces import IUUID, IUUIDAware
from zope.interface import implementer
from zope.component import queryU... | true | true |
f70391cad5dd31becb556ae04a51819ce17fe64b | 1,881 | py | Python | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | 1 | 2021-01-16T21:42:42.000Z | 2021-01-16T21:42:42.000Z | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | data-and-statistics/understanding-a-population-using-sampling.py | jeantardelli/math-with-python | 119bbbc62329c0d834d965232239bd3b39116cc1 | [
"MIT"
] | null | null | null | """
One of the central problems in statistics is to make estimations — and quantify
how good these estimations are — of the distribution of an entire population
given only a small (random) sample. A classic example is to estimate the average
height of all the people in a country when measuring the height of a randomly
... | 40.021277 | 80 | 0.758107 | import math
import pandas as pd
from scipy import stats
sample_data = pd.Series([
172.3, 171.3, 164.7, 162.9, 172.5, 176.3, 174.8, 171.9,
176.8, 167.8, 164.5, 179.7, 157.8, 170.6, 189.9, 185. ,
172.7, 165.5, 174.5, 171.5])
sample_mean = sample_data.mean()
sample_std = sample_data.std()
print(f"Mean: {sa... | true | true |
f703920ef91c9979de1ce19afa587a2ed363587a | 500 | py | Python | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | algorithm/github_al/flatten.py | freedomDR/coding | 310a68077de93ef445ccd2929e90ba9c22a9b8eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Iterable
def flatten(input_arr, output_arr = None):
if output_arr is None:
output_arr = []
for t in input_arr:
if isinstance(t, Iterable):
flatten(t, output_arr)
else:
output_arr.append(t)
... | 22.727273 | 42 | 0.592 |
from collections import Iterable
def flatten(input_arr, output_arr = None):
if output_arr is None:
output_arr = []
for t in input_arr:
if isinstance(t, Iterable):
flatten(t, output_arr)
else:
output_arr.append(t)
return output_arr
def flatten_iter(iterabl... | true | true |
f703926c80160625841d05702077db2125d9440e | 23,974 | py | Python | keras/optimizer_v2/rmsprop_test.py | Bhavay192/keras | ed6ca50cceb2a071f86e5e9af5076b1d62fd2531 | [
"Apache-2.0"
] | 37,222 | 2017-12-13T00:52:55.000Z | 2022-03-31T22:34:35.000Z | keras/optimizer_v2/rmsprop_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 7,624 | 2017-12-13T01:03:40.000Z | 2022-03-31T23:57:24.000Z | keras/optimizer_v2/rmsprop_test.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 14,914 | 2017-12-13T02:30:46.000Z | 2022-03-30T14:49:16.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.633898 | 114 | 0.616042 |
import tensorflow.compat.v2 as tf
import copy
import itertools
import math
from absl.testing import parameterized
import numpy as np
from tensorflow.python.framework import test_util
from keras import combinations
from keras import testing_utils
from keras.optimizer_v2 import learning_rate_schedule
fro... | true | true |
f703935a81099d2c4a2a54350f54542dcb59b99b | 9,815 | py | Python | visualization/visualizer/ArcBall.py | zhigangjiang/LGT-Net | d9a619158b2dc66a50c100e7fa7e491f1df16fd7 | [
"MIT"
] | 11 | 2022-03-03T17:49:33.000Z | 2022-03-25T11:23:11.000Z | visualization/visualizer/ArcBall.py | zhigangjiang/LGT-Net | d9a619158b2dc66a50c100e7fa7e491f1df16fd7 | [
"MIT"
] | 3 | 2021-05-03T08:06:13.000Z | 2022-01-13T15:21:28.000Z | ArcBall.py | fuenwang/360LayoutVisualizer | 36a7b0e17be6491800c6904d0a9ec0ffcd1b5249 | [
"MIT"
] | 1 | 2022-03-04T06:39:50.000Z | 2022-03-04T06:39:50.000Z | """
ArcBall.py -- Math utilities, vector, matrix types and ArcBall quaternion rotation class
>>> unit_test_ArcBall_module ()
unit testing ArcBall
Quat for first drag
[ 0.08438914 -0.08534209 -0.06240178 0.99080837]
First transform
[[ 0.97764552 -0.1380603 0.15858325 0. ]
[ 0.10925253 0.97796899 0.1778779... | 30.29321 | 111 | 0.652573 |
try:
import numpy as Numeric
def sumDot( a,b ):
return Numeric.dot (a, b)
except ImportError:
try:
import Numeric
def sumDot( a,b ):
return sum (Numeric.dot (a, b) )
except ImportError:
print ("This demo requires the numpy or Numeric extension, sorry")
import sys
sys.exit()
import copy
from math im... | true | true |
f70393d6c78a695c7990d9fcc63b60178e2de3e0 | 2,786 | py | Python | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 8 | 2020-12-06T13:04:57.000Z | 2021-12-14T23:00:56.000Z | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | null | null | null | tests/test_filesystem.py | WojciechKusa/datasets | 1406a04c3e911cec2680d8bc513653e0cafcaaa4 | [
"Apache-2.0"
] | 1 | 2022-01-25T21:15:46.000Z | 2022-01-25T21:15:46.000Z | import os
import boto3
import fsspec
import pytest
from moto import mock_s3
from datasets.filesystems import (
COMPRESSION_FILESYSTEMS,
HfFileSystem,
S3FileSystem,
extract_path_from_uri,
is_remote_filesystem,
)
from .utils import require_lz4, require_zstandard
@pytest.fixture(scope="function")
... | 33.166667 | 116 | 0.739052 | import os
import boto3
import fsspec
import pytest
from moto import mock_s3
from datasets.filesystems import (
COMPRESSION_FILESYSTEMS,
HfFileSystem,
S3FileSystem,
extract_path_from_uri,
is_remote_filesystem,
)
from .utils import require_lz4, require_zstandard
@pytest.fixture(scope="function")
... | true | true |
f703943fbc79d0f254b8d08ea640cf0e5c86ba5f | 3,639 | py | Python | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 3 | 2021-08-06T05:01:39.000Z | 2021-08-11T03:31:44.000Z | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 5 | 2016-09-22T20:18:11.000Z | 2018-10-19T00:00:24.000Z | facebook_business/adobjects/messengerdestinationpagewelcomemessage.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 1 | 2021-02-25T16:20:58.000Z | 2021-02-25T16:20:58.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 38.305263 | 103 | 0.706238 |
from facebook_business.adobjects.abstractobject import AbstractObject
from facebook_business.adobjects.abstractcrudobject import AbstractCrudObject
from facebook_business.adobjects.objectparser import ObjectParser
from facebook_business.api import FacebookRequest
from facebook_business.typechecker i... | true | true |
f70394ae6aab6d7f593c2084d4429207c49d3d56 | 1,245 | py | Python | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | courses/src/task_app/serializers/task_file.py | yuramorozov01/courses_system | 582532b2a2753d89642e1e8dbee0f369774638b1 | [
"Apache-2.0"
] | null | null | null | from base_app.serializers import CustomUserSerializer
from rest_framework import serializers
from task_app.models import TaskFile
class TaskFileCreateSerializer(serializers.ModelSerializer):
'''Serializer for creating task files'''
author = CustomUserSerializer(read_only=True)
class Meta:
model ... | 29.642857 | 77 | 0.718072 | from base_app.serializers import CustomUserSerializer
from rest_framework import serializers
from task_app.models import TaskFile
class TaskFileCreateSerializer(serializers.ModelSerializer):
author = CustomUserSerializer(read_only=True)
class Meta:
model = TaskFile
fields = '__all__'
... | true | true |
f70394c0c84001797c89a541d9f24d7cf0bd3eb7 | 11,469 | py | Python | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | 1 | 2020-07-09T02:10:18.000Z | 2020-07-09T02:10:18.000Z | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | 3 | 2020-03-24T17:56:04.000Z | 2021-02-02T22:16:31.000Z | ckan/model/license.py | sabinem/ckan | dfad5d98a644a76939a57872073ef27dc7c68d86 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import datetime
import re
import requests
from ckan.common import config
from ckan.common import asbool
from six import text_type, string_types
from ckan.common import _, json
import ckan.lib.maintain as maintain
log = __import__('logging').getLogger(__name__)
class License(object):
"""Doma... | 31.250681 | 82 | 0.608684 |
import datetime
import re
import requests
from ckan.common import config
from ckan.common import asbool
from six import text_type, string_types
from ckan.common import _, json
import ckan.lib.maintain as maintain
log = __import__('logging').getLogger(__name__)
class License(object):
def __init__(self, data... | true | true |
f70394c4b4c5b9d7822853ff5865b2756c9dd6bc | 1,768 | py | Python | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 387 | 2017-02-11T18:28:50.000Z | 2022-03-27T01:16:05.000Z | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 18 | 2017-12-15T03:10:25.000Z | 2021-04-20T14:32:43.000Z | Chapter 10/code/category_predictor.py | shivampotdar/Artificial-Intelligence-with-Python | 00221c3b1a6d8003765d1ca48b5c95f86da375d9 | [
"MIT"
] | 407 | 2017-01-23T15:18:33.000Z | 2022-03-16T05:39:02.000Z | from sklearn.datasets import fetch_20newsgroups
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
# Define the category map
category_map = {'talk.politics.misc': 'Politics', 'rec.autos': 'Autos',
... | 36.081633 | 79 | 0.769796 | from sklearn.datasets import fetch_20newsgroups
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
category_map = {'talk.politics.misc': 'Politics', 'rec.autos': 'Autos',
'rec.sport.hockey': 'H... | true | true |
f7039603998c5edc3cabdaf934821dfecab387fe | 1,434 | py | Python | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | ada_friend_app/api/login.py | ratopythonista/ada-friend | 0b40afb3b7b4b60980663e962ccd455d6436345d | [
"MIT"
] | null | null | null | from loguru import logger
from flask import request
from flasgger import swag_from
from flask_restful import Resource
from jwt.exceptions import ExpiredSignatureError
from ada_friend_app.modulo.cripto import Sha256
from ada_friend_app.modulo.jwt_auth import Token
from ada_friend_app.api.resposta_api import Resposta
fr... | 37.736842 | 97 | 0.608089 | from loguru import logger
from flask import request
from flasgger import swag_from
from flask_restful import Resource
from jwt.exceptions import ExpiredSignatureError
from ada_friend_app.modulo.cripto import Sha256
from ada_friend_app.modulo.jwt_auth import Token
from ada_friend_app.api.resposta_api import Resposta
fr... | true | true |
f70396193135830ef2d1de8e357842ea1ef0eea2 | 747 | py | Python | PaddleCV/PaddleDetection/ppdet/experimental/__init__.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | 7,782 | 2019-10-25T09:39:37.000Z | 2022-03-31T13:44:14.000Z | static/ppdet/experimental/__init__.py | siqi-yang/PaddleDetection | d7383ad99c69e03f984ead52cc645d17f4729837 | [
"Apache-2.0"
] | 3,499 | 2019-10-29T12:37:40.000Z | 2022-03-31T14:51:56.000Z | static/ppdet/experimental/__init__.py | siqi-yang/PaddleDetection | d7383ad99c69e03f984ead52cc645d17f4729837 | [
"Apache-2.0"
] | 1,874 | 2019-10-28T04:21:58.000Z | 2022-03-31T05:41:21.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.571429 | 74 | 0.776439 |
from __future__ import absolute_import
from .mixed_precision import *
from . import mixed_precision
__all__ = mixed_precision.__all__
| true | true |
f70396c8be176b604dce67ff49b19ec44c86cdc8 | 1,328 | py | Python | rasa/cli/arguments/data.py | deepmipt/rasa | f0cc0ff6e515df2249998ff4e788009cccaecc02 | [
"Apache-2.0"
] | 2 | 2021-02-19T07:19:27.000Z | 2022-01-19T09:00:43.000Z | rasa/cli/arguments/data.py | RakibulAsheeque/rasa | 7d3804cd081c73d78ab5e973f95a55845eed1e89 | [
"Apache-2.0"
] | 6 | 2020-01-28T22:55:28.000Z | 2022-02-10T00:20:45.000Z | rasa/cli/arguments/data.py | RakibulAsheeque/rasa | 7d3804cd081c73d78ab5e973f95a55845eed1e89 | [
"Apache-2.0"
] | 1 | 2022-01-19T09:00:45.000Z | 2022-01-19T09:00:45.000Z | import argparse
from rasa.cli.arguments.default_arguments import (
add_nlu_data_param,
add_out_param,
add_data_param,
add_domain_param,
)
def set_convert_arguments(parser: argparse.ArgumentParser):
add_data_param(parser, required=True, default=None, data_type="Rasa NLU ")
add_out_param(
... | 25.538462 | 84 | 0.665663 | import argparse
from rasa.cli.arguments.default_arguments import (
add_nlu_data_param,
add_out_param,
add_data_param,
add_domain_param,
)
def set_convert_arguments(parser: argparse.ArgumentParser):
add_data_param(parser, required=True, default=None, data_type="Rasa NLU ")
add_out_param(
... | true | true |
f703974e9d75f9f9f38c70017d90be9c33941f4b | 3,275 | py | Python | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | 1 | 2020-02-28T15:37:35.000Z | 2020-02-28T15:37:35.000Z | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | null | null | null | src/trading_simulation/simulation.py | andrzejmalota/StockPricePrediction | a6d7da353b706fb2d970f2883841db14d896268f | [
"MIT"
] | 1 | 2020-07-09T02:41:15.000Z | 2020-07-09T02:41:15.000Z | import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Simulation:
def __init__(self, init_investment, stock_returns, strategy, predicted_movements=None):
self.init_investment = init_investment
self.predicted_movements = predicted_movements
self.stock_retur... | 38.988095 | 108 | 0.654656 | import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class Simulation:
def __init__(self, init_investment, stock_returns, strategy, predicted_movements=None):
self.init_investment = init_investment
self.predicted_movements = predicted_movements
self.stock_retur... | true | true |
f70398596acf9ff285114deab4a95eb353a9e137 | 5,676 | py | Python | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/interactive/azext_interactive/azclishell/configuration.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 37.84 | 122 | 0.592319 |
from __future__ import print_function
import os
from six.moves import configparser
from prompt_toolkit import prompt
from azure.cli.core._help import PRIVACY_STATEMENT
SELECT_SYMBOL = {
'outside': '#',
'query': '??',
'example': '::',
'exit_code': '$',
'scope': '%%',
'unscope': '..'
}
... | true | true |
f70398e1f175d5b25119973036ab52f724bcd197 | 1,279 | py | Python | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | setup.py | cunningr/yanccm | 2d8f891d704672f4d3a15472c7a13edf7832d53d | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='yanccm',
packages=[
'controller',
'sot',
'ncservice',
'ncservice.configDb',
'ncservice.ncDeviceOps',
'ncservice.ncDeviceOps.threaded',
'view'],
version='0.0.2',
license='MIT',
description='''YANCCM... | 29.068182 | 113 | 0.591087 | from distutils.core import setup
setup(
name='yanccm',
packages=[
'controller',
'sot',
'ncservice',
'ncservice.configDb',
'ncservice.ncDeviceOps',
'ncservice.ncDeviceOps.threaded',
'view'],
version='0.0.2',
license='MIT',
description='''YANCCM... | true | true |
f7039945cbf7c33f6d0a0a69ac4129d20b76d598 | 194 | py | Python | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | src/terregex/__init__.py | m1kit/terregex | b8a809b2db664f26f90f7da29481be97cf6959f7 | [
"Apache-2.0"
] | null | null | null | from terregex.mlr import Node, NodeList, Literal, NotLiteral, \
In, Negate, Range, Category, MinRepeat, MaxRepeat, \
SubPattern, Branch, Any, parse
from terregex.transform import Transformer | 48.5 | 63 | 0.778351 | from terregex.mlr import Node, NodeList, Literal, NotLiteral, \
In, Negate, Range, Category, MinRepeat, MaxRepeat, \
SubPattern, Branch, Any, parse
from terregex.transform import Transformer | true | true |
f70399bc2b81b97e423fbbbaf3c843a17a7dcaf9 | 1,452 | py | Python | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/prinseq-lite/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PrinseqLite(Package):
"""PRINSEQ will help you to preprocess your genomic or metagenomic
... | 34.571429 | 101 | 0.643251 |
from spack import *
class PrinseqLite(Package):
homepage = "http://prinseq.sourceforge.net"
url = "https://sourceforge.net/projects/prinseq/files/standalone/prinseq-lite-0.20.4.tar.gz"
version('0.20.4', sha256='9b5e0dce3b7f02f09e1cc7e8a2dd77c0b133e5e35529d570ee901f53ebfeb56f')
variant('no... | true | true |
f7039b4c486e283b178471dcf9b70206d4183022 | 81,410 | py | Python | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | 1 | 2021-06-11T22:09:38.000Z | 2021-06-11T22:09:38.000Z | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_linprog.py | pranavrajpal/scipy | 7dcdeffed53483a60b3e054618520e0f28adeba4 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:44:38.000Z | 2021-09-13T20:44:38.000Z | """
Unit test for Linear Programming
"""
import sys
import numpy as np
from numpy.testing import (assert_, assert_allclose, assert_equal,
assert_array_less, assert_warns, suppress_warnings)
from pytest import raises as assert_raises
from scipy.optimize import linprog, OptimizeWarning
from sc... | 39.008146 | 107 | 0.542132 | import sys
import numpy as np
from numpy.testing import (assert_, assert_allclose, assert_equal,
assert_array_less, assert_warns, suppress_warnings)
from pytest import raises as assert_raises
from scipy.optimize import linprog, OptimizeWarning
from scipy.sparse.linalg import MatrixRankWarnin... | true | true |
f7039b99de5e7aefe25f080a32f03253b9c3ea2f | 3,573 | py | Python | tests/unit/agroapi10/test_polygon.py | ChuckVanHoff/pyowm | 86735d8629ead2cfa0232b0f8ec0b88ab16eff11 | [
"MIT"
] | 1 | 2019-06-01T07:47:12.000Z | 2019-06-01T07:47:12.000Z | tests/unit/agroapi10/test_polygon.py | cjsgh901/pyowm | cdd59eb72f32f7238624ceef9b2e2329a5ebd472 | [
"MIT"
] | null | null | null | tests/unit/agroapi10/test_polygon.py | cjsgh901/pyowm | cdd59eb72f32f7238624ceef9b2e2329a5ebd472 | [
"MIT"
] | 1 | 2020-01-20T22:54:02.000Z | 2020-01-20T22:54:02.000Z | import unittest
from pyowm.agroapi10.polygon import Polygon, GeoPoint, GeoPolygon
class TestPolygon(unittest.TestCase):
geopoint= GeoPoint(34, -56.3)
geopolygon = GeoPolygon([
[[2.3, 57.32], [23.19, -20.2], [-120.4, 19.15], [2.3, 57.32]]
])
def test_polygon_fails_with_wrong_parameters(self):... | 38.836957 | 114 | 0.563672 | import unittest
from pyowm.agroapi10.polygon import Polygon, GeoPoint, GeoPolygon
class TestPolygon(unittest.TestCase):
geopoint= GeoPoint(34, -56.3)
geopolygon = GeoPolygon([
[[2.3, 57.32], [23.19, -20.2], [-120.4, 19.15], [2.3, 57.32]]
])
def test_polygon_fails_with_wrong_parameters(self):... | true | true |
f7039c4f0f970d872e14754af77e13a6dcf2b429 | 207 | py | Python | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | module10-writing.api.with.flask/utility/rest.py | deepcloudlabs/dcl162-2020-sep-02 | abd21c59d89985e9f5922df65fd1a5ccab019de4 | [
"MIT"
] | null | null | null | def convert_request_to_dictionary(request, fields):
emp = {}
for field in fields:
if field in request.json:
emp[field] = request.json[field]
del emp["identity"]
return emp | 29.571429 | 51 | 0.63285 | def convert_request_to_dictionary(request, fields):
emp = {}
for field in fields:
if field in request.json:
emp[field] = request.json[field]
del emp["identity"]
return emp | true | true |
f7039caff8ee44c13e6b74d8f1920cff661c5ead | 481 | py | Python | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | manuscript/tools/play.py | anterokangas/ManuscriptManagerOld | 194bc6c7b899bb4ab61966af3ba1e619fc74c20c | [
"MIT"
] | null | null | null | import os
from pydub import playback
from playsound import playsound
from simpleaudio import play_buffer
import winsound
from manuscript.tools.counter import Counter
def play_sound(sound, block=True):
if sound is not None:
prefix = "tmp"
with Counter(prefix) as counter:
tmp_file = os.... | 26.722222 | 73 | 0.673597 | import os
from pydub import playback
from playsound import playsound
from simpleaudio import play_buffer
import winsound
from manuscript.tools.counter import Counter
def play_sound(sound, block=True):
if sound is not None:
prefix = "tmp"
with Counter(prefix) as counter:
tmp_file = os.... | true | true |
f7039ccc97e8de2fedf8a71747166960ca9d7503 | 429 | py | Python | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | TelegramBot/utility.py | Otkuda/telebot | 5bbd901c74340922e349f5ac372ce238eb682877 | [
"CC0-1.0"
] | null | null | null | from telegram import ReplyKeyboardMarkup, KeyboardButton
def get_keyboard():
contact_button = KeyboardButton('Отправить контакты', request_contact=True)
location_button = KeyboardButton('Отправить локацию', request_location=True)
my_keyboard = ReplyKeyboardMarkup([['Анекдот', 'Начать'],
... | 47.666667 | 97 | 0.706294 | from telegram import ReplyKeyboardMarkup, KeyboardButton
def get_keyboard():
contact_button = KeyboardButton('Отправить контакты', request_contact=True)
location_button = KeyboardButton('Отправить локацию', request_location=True)
my_keyboard = ReplyKeyboardMarkup([['Анекдот', 'Начать'],
... | true | true |
f7039eb952f4df789dbf533948f40ffcbf2abfb4 | 28,246 | py | Python | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 213 | 2021-09-24T03:26:53.000Z | 2022-03-30T07:11:48.000Z | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 247 | 2021-09-23T18:49:45.000Z | 2022-03-31T17:19:02.000Z | python/torch_mlir/dialects/torch/importer/jit_ir/build_tools/torch_ods_gen.py | llvm/torch-mlir | 2b1b0f6e1970c9db13caea2515070c61d4dee167 | [
"Apache-2.0"
] | 68 | 2021-09-23T18:23:20.000Z | 2022-03-29T11:18:58.000Z | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
"""Queries the pytorch op registry and generates ODS and CC sourc... | 47.234114 | 128 | 0.568434 |
from typing import List, Optional, TextIO
import argparse
import logging
import os
import sys
from .utils import TextEmitter
from .registry import Registry, JitOperator
TORCH_TYPE_TO_ODS_TYPE = {
"Tensor": "AnyTorchTensorType",
"Tensor?": "AnyTorchOptionalTensorType",
"Tensor?[]": "AnyTorchListOfO... | true | true |
f7039ed8f3ea00ea4a9006ac8bbcd14458307bde | 2,085 | py | Python | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | 1 | 2020-08-28T20:38:54.000Z | 2020-08-28T20:38:54.000Z | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | null | null | null | MaixPy/components/micropython/port/src/ulab/micropython-ulab/docs/manual/source/conf.py | valerio-vaccaro/krux | a3718a4e12ef6f92ada98e02d0d286a971a56434 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 30.661765 | 79 | 0.667626 |
project = 'micropython-ulab'
copyright = '2019, Zoltán Vörös'
author = 'Zoltán Vörös'
release = '0.26'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
master_doc = 'index'
author=u'Zoltán... | true | true |
f7039f924072b7979a9db1aca50b6ea7282999b5 | 1,613 | py | Python | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | 1 | 2021-01-12T01:04:00.000Z | 2021-01-12T01:04:00.000Z | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | null | null | null | src/textlabelling/experimentparam.py | aakinlalu/textlabelling | e2c8fe5f68e92d70249d37cd6eb13a3ab046a891 | [
"MIT"
] | null | null | null | import spacy
from spacy.lang.en import English
from spacy.util import minibatch, compounding
from spacy.util import decaying
class ExperimentParam:
def __init__(self, TRAIN_DATA: list, max_batch_sizes: dict, model_type='ner',
dropout_start: float = 0.6, dropout_end: float = 0.2, interval: float =... | 40.325 | 269 | 0.6677 | import spacy
from spacy.lang.en import English
from spacy.util import minibatch, compounding
from spacy.util import decaying
class ExperimentParam:
def __init__(self, TRAIN_DATA: list, max_batch_sizes: dict, model_type='ner',
dropout_start: float = 0.6, dropout_end: float = 0.2, interval: float =... | true | true |
f7039fc4a1a734c44cfbc0383120c8162bc3c829 | 678 | py | Python | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m14_metaclass/register_cls/example_2/main.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | from example_system import serializer
from example_system.bike import Bike
from example_system.human import Human
def run_example() -> None:
krzysztof = Human(name="Krzysztof", age=37)
giant_bike = Bike(brand="Giant", model="Contend AR")
krzysztof_json = serializer.serialize(krzysztof)
print(krzyszto... | 27.12 | 67 | 0.755162 | from example_system import serializer
from example_system.bike import Bike
from example_system.human import Human
def run_example() -> None:
krzysztof = Human(name="Krzysztof", age=37)
giant_bike = Bike(brand="Giant", model="Contend AR")
krzysztof_json = serializer.serialize(krzysztof)
print(krzyszto... | true | true |
f703a0383ac9c6b9d0f7e37d998648f8cfbc1ec4 | 343 | py | Python | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiSmartdeviceBatcheventPostRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.11.25
'''
from dingtalk.api.base import RestApi
class OapiSmartdeviceBatcheventPostRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.device_event_vos = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.smartd... | 22.866667 | 52 | 0.772595 | from dingtalk.api.base import RestApi
class OapiSmartdeviceBatcheventPostRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.device_event_vos = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.smartdevice.batchevent.post'
| true | true |
f703a1141807b8881b25f73ca2ae811357879d80 | 1,032 | py | Python | hermione/module_templates/__IMPLEMENTED_BASE__/src/predict.py | RodrigoATorres/hermione | 6cbed73e309f8025a48f33165d8f29561c6a3cc7 | [
"Apache-2.0"
] | 183 | 2020-06-03T22:43:14.000Z | 2022-03-17T22:39:07.000Z | hermione/file_text/predict.txt | gquaresma89/hermione | c51f5e54a41609099eef48990c7ad7018dcdf41a | [
"Apache-2.0"
] | 31 | 2020-06-03T22:55:18.000Z | 2022-03-27T20:06:17.000Z | hermione/file_text/predict.txt | gquaresma89/hermione | c51f5e54a41609099eef48990c7ad7018dcdf41a | [
"Apache-2.0"
] | 43 | 2020-06-03T22:45:03.000Z | 2021-12-29T19:43:54.000Z | import pandas as pd
import io
from joblib import load
import logging
logging.getLogger().setLevel(logging.INFO)
def generate_data():
new_data = pd.DataFrame({
'Pclass':[3,2,1],
'Sex': ['male', 'female', 'male'],
'Age':[4, 22, 28]
})
return new_data
def load_model():
try:
... | 20.64 | 60 | 0.584302 | import pandas as pd
import io
from joblib import load
import logging
logging.getLogger().setLevel(logging.INFO)
def generate_data():
new_data = pd.DataFrame({
'Pclass':[3,2,1],
'Sex': ['male', 'female', 'male'],
'Age':[4, 22, 28]
})
return new_data
def load_model():
try:
... | true | true |
f703a230af22a6d9ac2792f00e4cc97acc420aa4 | 8,919 | py | Python | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | src/frico/blocks.py | mmangus/frico | 0d95340a53a7f6da3792fdd241eb3ed986fe894b | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from datetime import datetime
from typing import Generic, Type, TypeVar, Union
from .devices import I2CDevice
from .parsers import RegisterParser
from .typing import RegisterState
BlockType = TypeVar("BlockType")
class RegisterBlock(Generic[BlockType], ABC):
"""
Abstract ... | 38.947598 | 79 | 0.659603 | from abc import ABC, abstractmethod
from datetime import datetime
from typing import Generic, Type, TypeVar, Union
from .devices import I2CDevice
from .parsers import RegisterParser
from .typing import RegisterState
BlockType = TypeVar("BlockType")
class RegisterBlock(Generic[BlockType], ABC):
@property
de... | true | true |
f703a27ca290c7545f1f668cdb2157b3fb23e494 | 65 | py | Python | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | atompack/__init__.py | seatonullberg/atompack | 5d488ec8a4949cdeea3a97072ed092cc331c2198 | [
"MIT"
] | null | null | null | """A flexible Python library for atomic structure generation."""
| 32.5 | 64 | 0.769231 | true | true | |
f703a2fda15b537ff3df48a0cd9175e8f5d2f38c | 43,765 | py | Python | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 33 | 2021-06-26T22:50:48.000Z | 2022-02-09T04:31:40.000Z | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 18 | 2021-06-27T17:13:13.000Z | 2022-01-04T11:45:56.000Z | seno/rpc/wallet_rpc_api.py | emilson0407/seno-blockchain | fa73fc06639faaacbb82504a6c8698c3bcab57c0 | [
"Apache-2.0"
] | 19 | 2021-06-26T00:17:08.000Z | 2022-03-15T06:58:21.000Z | import asyncio
import logging
import time
from datetime import datetime
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from seno.cmds.init_funcs import check_keys
from seno.consensus.block_rewards import calculate_base_farmer_reward
from seno.... | 44.476626 | 120 | 0.60882 | import asyncio
import logging
import time
from datetime import datetime
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple
from blspy import PrivateKey, G1Element
from seno.cmds.init_funcs import check_keys
from seno.consensus.block_rewards import calculate_base_farmer_reward
from seno.... | true | true |
f703a3ab24005dbecdddfd6bf01d5f0da3cef21d | 1,702 | py | Python | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | 1 | 2022-01-28T16:52:40.000Z | 2022-01-28T16:52:40.000Z | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | null | null | null | tests/test_networks.py | bee-hive/nested-policy-rl | 56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c | [
"MIT"
] | null | null | null | import torch
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
# import sys
# sys.path.append("../simulated_fqi/")
from simulated_fqi import NFQNetwork, ContrastiveNFQNetwork
import matplotlib.pyplot as plt
import numpy as np
def train(x, y, groups, network, optimizer):
predicted... | 27.901639 | 97 | 0.632197 | import torch
import torch.optim as optim
import torch.nn.functional as F
import torch.nn as nn
from simulated_fqi import NFQNetwork, ContrastiveNFQNetwork
import matplotlib.pyplot as plt
import numpy as np
def train(x, y, groups, network, optimizer):
predicted_q_values = network(x, groups).squeeze()
loss ... | true | true |
f703a3ad013a7914e2e45a7ac2c29a6df6b1ce61 | 381 | py | Python | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/tw/wsgi.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for tw project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_M... | 22.411765 | 78 | 0.779528 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tw.settings")
application = get_wsgi_application()
| true | true |
f703a3c46f875bef0458a54b32b51c5f0011535b | 1,315 | py | Python | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 31 | 2020-07-17T09:10:14.000Z | 2022-03-19T06:32:09.000Z | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 4 | 2020-09-16T09:50:30.000Z | 2021-11-23T06:34:33.000Z | libs/utils_torch.py | SixHeo/IVOS-ATNet | 1cf574953a96bd680c518c6362b510fd103ff271 | [
"MIT"
] | 3 | 2020-07-17T09:09:38.000Z | 2020-08-08T12:43:43.000Z | import torch
def combine_masks_with_batch(masks, n_obj, th=0.5, return_as_onehot = False):
""" Combine mask for different objects.
Different methods are the following:
* `max_per_pixel`: Computes the final mask taking the pixel with the highest
probability for every object.
# ... | 35.540541 | 84 | 0.607605 | import torch
def combine_masks_with_batch(masks, n_obj, th=0.5, return_as_onehot = False):
marker = torch.argmax(masks, dim=1, keepdim=True)
if not return_as_onehot:
out_mask = torch.unsqueeze(torch.zeros_like(masks)[:,0],1)
for obj_id in range(n_obj):
try :tmp_mask = (... | true | true |
f703a42c92053186384ad6eaafe8ad76c4d7b51e | 120 | py | Python | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 2 | 2019-03-06T15:48:20.000Z | 2020-05-02T15:02:57.000Z | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 5 | 2019-01-23T11:35:41.000Z | 2019-03-29T17:36:19.000Z | python/GtBurst/Task.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | null | null | null | class Task(object):
def __init__(self,name):
self.name = name
pass
def run(self):
pass
| 15 | 36 | 0.533333 | class Task(object):
def __init__(self,name):
self.name = name
pass
def run(self):
pass
| true | true |
f703a432e4ed647c1bb292ffa21bc5f491234419 | 628 | py | Python | manage.py | dyhmzall/budget | 693ed201ce65ec5f2656759c8d417ca24a49416b | [
"MIT"
] | null | null | null | manage.py | dyhmzall/budget | 693ed201ce65ec5f2656759c8d417ca24a49416b | [
"MIT"
] | 1 | 2021-02-02T10:03:33.000Z | 2021-02-02T10:03:33.000Z | manage.py | dyhmzall/budget | 693ed201ce65ec5f2656759c8d417ca24a49416b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geekshop.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impor... | 28.545455 | 73 | 0.683121 |
import os
import sys
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geekshop.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f703a44c1907fc72f119630ad4366b80be2e6fbf | 3,795 | py | Python | wb/main/jobs/export_inference_report/export_inference_report_job.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 23 | 2022-03-17T12:24:09.000Z | 2022-03-31T09:13:30.000Z | wb/main/jobs/export_inference_report/export_inference_report_job.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 18 | 2022-03-21T08:17:44.000Z | 2022-03-30T12:42:30.000Z | wb/main/jobs/export_inference_report/export_inference_report_job.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 16 | 2022-03-17T12:24:14.000Z | 2022-03-31T12:15:12.000Z | """
OpenVINO DL Workbench
Class for creation job for creating and exporting inference report
Copyright (c) 2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://... | 46.851852 | 110 | 0.680896 | import csv
import json
import os
from contextlib import closing
from sqlalchemy.orm import Session
from wb.extensions_factories.database import get_db_session_for_celery
from wb.main.enumerates import JobTypesEnum, StatusEnum
from wb.main.jobs.interfaces.ijob import IJob
from wb.main.jobs.interfaces.job_observers imp... | true | true |
f703a44ccaf83acb8a92c16a75f05aff6da856a0 | 109 | py | Python | caffe-tensorflow/kaffe/errors.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 3,209 | 2015-11-10T06:52:59.000Z | 2022-03-10T05:17:28.000Z | caffe-tensorflow/kaffe/errors.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 207 | 2017-01-01T17:58:57.000Z | 2021-11-06T21:40:14.000Z | caffe-tensorflow/kaffe/errors.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 1,218 | 2015-11-10T23:55:48.000Z | 2022-01-07T07:36:57.000Z | import sys
class KaffeError(Exception):
pass
def print_stderr(msg):
sys.stderr.write('%s\n' % msg)
| 13.625 | 34 | 0.678899 | import sys
class KaffeError(Exception):
pass
def print_stderr(msg):
sys.stderr.write('%s\n' % msg)
| true | true |
f703a55785709def35ca98b2131d75c174529cbf | 1,241 | py | Python | tests/test_handler.py | priyanshu-kumar02/personfinder | d5390b60709cd0ccaaade9a3b6224a60cd523ed9 | [
"Apache-2.0"
] | 561 | 2015-02-16T07:59:42.000Z | 2022-03-30T17:31:21.000Z | tests/test_handler.py | Anthonymcqueen21/personfinder | ee7791fbc434eb4ec5cfad449288a1e884db5b1e | [
"Apache-2.0"
] | 591 | 2015-01-30T05:09:30.000Z | 2022-02-26T09:31:25.000Z | tests/test_handler.py | Anthonymcqueen21/personfinder | ee7791fbc434eb4ec5cfad449288a1e884db5b1e | [
"Apache-2.0"
] | 258 | 2015-01-25T18:35:12.000Z | 2021-12-25T01:44:14.000Z | # Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 34.472222 | 74 | 0.734085 |
__author__ = 'lschumacher@google.com (Lee Schumacher)'
import main
import webob
import urllib
from google.appengine.ext import webapp
def initialize_handler(
handler_class, action, repo='haiti', environ=None, params=None):
params_str = ('?' + urllib.urlencode(params)) if params else ''
... | true | true |
f703a5c45317e7de4cb67aaa0ea6702a7d8961c4 | 1,832 | py | Python | chainer/functions/array/copy.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | 90 | 2017-02-23T04:04:47.000Z | 2020-04-09T12:06:50.000Z | chainer/functions/array/copy.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | 7 | 2017-07-23T13:38:06.000Z | 2018-07-10T07:09:03.000Z | chainer/functions/array/copy.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | 32 | 2017-02-28T07:40:38.000Z | 2021-02-17T11:33:09.000Z | from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
class Copy(function_node.FunctionNode):
"""Copies the input variable onto the specified device."""
def __init__(self, out_device):
self.out_device = out_device
def check_type_forward(self, i... | 29.079365 | 78 | 0.617358 | from chainer.backends import cuda
from chainer import function_node
from chainer.utils import type_check
class Copy(function_node.FunctionNode):
def __init__(self, out_device):
self.out_device = out_device
def check_type_forward(self, in_types):
type_check.expect(
in_types.size(... | true | true |
f703a604a7bd2e331c356593203c89fd82af1046 | 1,031 | py | Python | program_helper/ast/ops/leaf_ops/DSymtabMod.py | jajajaqlt/nsg | 1873f2b5e10441110c3c69940ceb4650f9684ac0 | [
"Apache-2.0"
] | 10 | 2021-11-02T18:30:38.000Z | 2022-03-21T06:31:33.000Z | program_helper/ast/ops/leaf_ops/DSymtabMod.py | rohanmukh/nag | f2c4b8e60a97c58a6a1c549cc8b4753ebfe8a5e3 | [
"Apache-2.0"
] | 2 | 2021-11-05T18:40:42.000Z | 2022-03-30T04:33:08.000Z | program_helper/ast/ops/leaf_ops/DSymtabMod.py | rohanmukh/nag | f2c4b8e60a97c58a6a1c549cc8b4753ebfe8a5e3 | [
"Apache-2.0"
] | 2 | 2021-11-03T19:14:06.000Z | 2021-11-03T23:47:09.000Z | # Copyright 2017 Rice University
#
# 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 writin... | 33.258065 | 76 | 0.71775 |
from program_helper.ast.ops import Node
from utilities.vocab_building_dictionary import DELIM
class DSymtabMod(Node):
def __init__(self, val,
type_helper=None,
child=None, sibling=None):
super().__init__(val, child, sibling)
self.type_helper = type_h... | true | true |
f703a64b7295f2cbaa086ee03b51c095d6f49bc4 | 263 | py | Python | app/forms/producao_finalizada_form.py | pedroferronato/gerenciamento-rural | 5ed873caf9fdf1da2a26938b8cee57b55e7636f0 | [
"MIT"
] | null | null | null | app/forms/producao_finalizada_form.py | pedroferronato/gerenciamento-rural | 5ed873caf9fdf1da2a26938b8cee57b55e7636f0 | [
"MIT"
] | null | null | null | app/forms/producao_finalizada_form.py | pedroferronato/gerenciamento-rural | 5ed873caf9fdf1da2a26938b8cee57b55e7636f0 | [
"MIT"
] | null | null | null | from datetime import date
from flask_wtf import FlaskForm
from wtforms import StringField
class ProducaoFinalizadasForm(FlaskForm):
nome = StringField('Nome:')
data_comeco = StringField('Data de início:')
data_coleta = StringField('Data de coleta:') | 29.222222 | 48 | 0.768061 | from datetime import date
from flask_wtf import FlaskForm
from wtforms import StringField
class ProducaoFinalizadasForm(FlaskForm):
nome = StringField('Nome:')
data_comeco = StringField('Data de início:')
data_coleta = StringField('Data de coleta:') | true | true |
f703a650e127f5b3b3e5ba7bf6a53f3f2cf81f06 | 2,501 | py | Python | automox_console_sdk/models/one_of_device_filters_inner_value_items.py | AutomoxCommunity/automox-console-sdk-python | 9e921b138d63f90750e071d0a40e1d7edfa06733 | [
"MIT"
] | 1 | 2021-10-05T22:09:10.000Z | 2021-10-05T22:09:10.000Z | automox_console_sdk/models/one_of_device_filters_inner_value_items.py | AutomoxCommunity/automox-console-sdk-python | 9e921b138d63f90750e071d0a40e1d7edfa06733 | [
"MIT"
] | 1 | 2021-09-16T06:00:51.000Z | 2021-09-16T06:00:51.000Z | automox_console_sdk/models/one_of_device_filters_inner_value_items.py | AutomoxCommunity/automox-console-sdk-python | 9e921b138d63f90750e071d0a40e1d7edfa06733 | [
"MIT"
] | 4 | 2021-09-16T02:35:32.000Z | 2022-02-16T01:09:57.000Z | # coding: utf-8
"""
Automox Console API
API for use with the Automox Console # noqa: E501
OpenAPI spec version: 2021-11-16
Contact: support@automox.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OneOfDeviceFilter... | 29.423529 | 90 | 0.565774 |
import pprint
import re
import six
class OneOfDeviceFiltersInnerValueItems(object):
swagger_types = {
}
attribute_map = {
}
def __init__(self):
self.discriminator = None
def to_dict(self):
result = {}
for attr, _ in six.iteritems(self.swagger_types):
... | true | true |
f703a6f04b8a6b8bcf74cd1faf596071853ca5d0 | 13,045 | py | Python | src/TDRPG.py | codysandahl/pygamer-simple-rpg | ebb7be7e474a95dfa29c1f7055ad0f7ed2b3101e | [
"MIT"
] | null | null | null | src/TDRPG.py | codysandahl/pygamer-simple-rpg | ebb7be7e474a95dfa29c1f7055ad0f7ed2b3101e | [
"MIT"
] | null | null | null | src/TDRPG.py | codysandahl/pygamer-simple-rpg | ebb7be7e474a95dfa29c1f7055ad0f7ed2b3101e | [
"MIT"
] | null | null | null | import ugame
import stage
import utils
GAME = None
#######################################################
# Game
class Game(stage.Stage):
"""Base class for a game and its display"""
# TODO: add game state machine
# TODO: make each screen a state, and make a transition between them when player overlaps with t... | 32.289604 | 164 | 0.630433 | import ugame
import stage
import utils
GAME = None
pauseObject):
self._pauseObject = pauseObject
def resume(self):
self._pauseObject = None
self._curFramesWaiting = 0
def gameLoop(self):
while True:
if self._pauseObject:
self._pauseObject.update()
elif self._curFramesWaiting ... | true | true |
f703a7594603428c46c23789bb1ed339b09979a3 | 1,136 | py | Python | kubi_ecs_logger/models/root_schema.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | 6 | 2019-12-15T12:47:06.000Z | 2022-01-11T08:54:58.000Z | kubi_ecs_logger/models/root_schema.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | null | null | null | kubi_ecs_logger/models/root_schema.py | kumina/kubi_ecs_logger | 64d9519e0759a24253a4edc53e0c024675033d1c | [
"BSD-3-Clause"
] | null | null | null | """
TODO: Add doc what this file is doing
"""
from marshmallow import Schema, post_dump
class RootSchema(Schema):
SKIP_VALUES = [None]
@post_dump
def remove_skip_values(self, data, many, **kwargs):
return {
key: value for key, value in data.items()
if value not in self.SKI... | 32.457143 | 66 | 0.553697 | from marshmallow import Schema, post_dump
class RootSchema(Schema):
SKIP_VALUES = [None]
@post_dump
def remove_skip_values(self, data, many, **kwargs):
return {
key: value for key, value in data.items()
if value not in self.SKIP_VALUES
}
@post_dump(pass_origin... | true | true |
f703a7955d6abdc825910fe297297ee33f76baef | 830 | py | Python | tensorflow/super_resolution/syndicai.py | muchemwal/models | 49fd0a8a61b0e5dab196014bf47de7f62d97c884 | [
"MIT"
] | 2 | 2021-09-25T04:24:15.000Z | 2022-01-19T14:04:36.000Z | tensorflow/super_resolution/syndicai.py | muchemwal/models | 49fd0a8a61b0e5dab196014bf47de7f62d97c884 | [
"MIT"
] | 53 | 2020-11-13T19:07:45.000Z | 2022-01-19T14:04:24.000Z | tensorflow/super_resolution/syndicai.py | muchemwal/models | 49fd0a8a61b0e5dab196014bf47de7f62d97c884 | [
"MIT"
] | 12 | 2020-10-16T11:41:35.000Z | 2022-03-16T05:58:10.000Z | import os
import io
import time
import base64
import functools
from PIL import Image
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
from helpers import *
os.environ["TFHUB_DOWNLOAD_PROGRESS"] = "True"
class PythonPredictor:
def __init__(self, config):
# Import TF-Hub module
... | 23.055556 | 81 | 0.674699 | import os
import io
import time
import base64
import functools
from PIL import Image
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
from helpers import *
os.environ["TFHUB_DOWNLOAD_PROGRESS"] = "True"
class PythonPredictor:
def __init__(self, config):
self.hub_module =... | true | true |
f703a8de7f659bb95c04b8627c44e3b904c79da1 | 7,768 | py | Python | sc2_academy/ppo/my_epsilon_greedy_policy.py | Ricechrispi/sc2_academy | 9ffed467fe019262035ac61d10c5cc3ee64a7bb2 | [
"Apache-2.0"
] | 2 | 2020-09-24T12:02:01.000Z | 2022-01-24T11:05:41.000Z | sc2_academy/ppo/my_epsilon_greedy_policy.py | Ricechrispi/sc2_academy | 9ffed467fe019262035ac61d10c5cc3ee64a7bb2 | [
"Apache-2.0"
] | null | null | null | sc2_academy/ppo/my_epsilon_greedy_policy.py | Ricechrispi/sc2_academy | 9ffed467fe019262035ac61d10c5cc3ee64a7bb2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 44.136364 | 109 | 0.686535 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Optional, Text
import tensorflow as tf
import tensorflow_probability as tfp
from tf_agents.bandits.policies import policy_utilities
from tf_agents.policies import ... | true | true |
f703a9c862cb7b5a61c531b4c724bf4d85a76283 | 792 | py | Python | Perro/tienda.py | SebaB29/Python | 8fe7b375e200d2a629e3ef83a2356002621267a6 | [
"MIT"
] | null | null | null | Perro/tienda.py | SebaB29/Python | 8fe7b375e200d2a629e3ef83a2356002621267a6 | [
"MIT"
] | null | null | null | Perro/tienda.py | SebaB29/Python | 8fe7b375e200d2a629e3ef83a2356002621267a6 | [
"MIT"
] | null | null | null | from os import system
def comprar(comida, juguetes):
comprado = ""
while not comprado:
system("cls")
comprar = (input("Que quiere comprar? Alimentos | Juguetes : ")).lower()
if comprar == "alimento":
print(f"Carne: {comida['carne']['cantidad']}|Agua: {comida['agua']['cantidad']}|Huesos: {comida['hueso'... | 24.75 | 122 | 0.638889 | from os import system
def comprar(comida, juguetes):
comprado = ""
while not comprado:
system("cls")
comprar = (input("Que quiere comprar? Alimentos | Juguetes : ")).lower()
if comprar == "alimento":
print(f"Carne: {comida['carne']['cantidad']}|Agua: {comida['agua']['cantidad']}|Huesos: {comida['hueso'... | true | true |
f703ab7f383253a03a598122cf344f36aac5f4c1 | 671 | py | Python | mlfinlab/microstructural_features/third_generation.py | scibol/mlfinlab | 3c80f269bc68b8cb9bcf863ceb3dc77fc14b6984 | [
"BSD-3-Clause"
] | 8 | 2020-04-19T08:09:34.000Z | 2022-03-30T20:49:40.000Z | mlfinlab/microstructural_features/third_generation.py | scibol/mlfinlab | 3c80f269bc68b8cb9bcf863ceb3dc77fc14b6984 | [
"BSD-3-Clause"
] | 1 | 2019-07-24T17:52:30.000Z | 2019-07-24T17:52:30.000Z | mlfinlab/microstructural_features/third_generation.py | scibol/mlfinlab | 3c80f269bc68b8cb9bcf863ceb3dc77fc14b6984 | [
"BSD-3-Clause"
] | 8 | 2020-08-09T02:25:04.000Z | 2022-03-20T15:08:11.000Z | """
Third generation models implementation (VPIN)
"""
import pandas as pd
def get_vpin(volume: pd.Series, buy_volume: pd.Series, window: int = 1) -> pd.Series:
"""
Get Volume-Synchronized Probability of Informed Trading (VPIN) from bars, p. 292-293.
:param volume: (pd.Series) bar volume
:param buy_vo... | 35.315789 | 121 | 0.710879 | import pandas as pd
def get_vpin(volume: pd.Series, buy_volume: pd.Series, window: int = 1) -> pd.Series:
sell_volume = volume - buy_volume
volume_imbalance = abs(buy_volume - sell_volume)
return volume_imbalance.rolling(window=window).mean() / volume
| true | true |
f703abc44854a43f352a92f4fe2b31a889a7c5f4 | 938 | py | Python | github3/gists/comment.py | kbakba/github3.py | ab5d6a59a3e3f3c7022184b0e5dd17968809dc03 | [
"BSD-3-Clause"
] | null | null | null | github3/gists/comment.py | kbakba/github3.py | ab5d6a59a3e3f3c7022184b0e5dd17968809dc03 | [
"BSD-3-Clause"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | venv/lib/python2.7/site-packages/github3/gists/comment.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | null | null | null | """
github3.gists.comment
---------------------
Module containing the logic for a GistComment
"""
from github3.models import BaseComment
from github3.users import User
class GistComment(BaseComment):
"""This object represents a comment on a gist.
Two comment instances can be checked like so::
c1... | 22.333333 | 72 | 0.613006 |
from github3.models import BaseComment
from github3.users import User
class GistComment(BaseComment):
def __init__(self, comment, session=None):
super(GistComment, self).__init__(comment, session)
self.user = None
if comment.get('user'):
self.user = User(c... | true | true |
f703adb6f717d60f71886dce78d79117e78f66ac | 5,223 | py | Python | NeuralNetwork.py | ronnith24/NeuralNetworksFromScratch | 5c831de8954a4b84fef7b70b16f9d9e6c1cb24b9 | [
"MIT"
] | null | null | null | NeuralNetwork.py | ronnith24/NeuralNetworksFromScratch | 5c831de8954a4b84fef7b70b16f9d9e6c1cb24b9 | [
"MIT"
] | null | null | null | NeuralNetwork.py | ronnith24/NeuralNetworksFromScratch | 5c831de8954a4b84fef7b70b16f9d9e6c1cb24b9 | [
"MIT"
] | null | null | null | import numpy as np
class NeuralNetwork(object):
def __init__(self, topology, epsilon, numLabels):
self.theta = []
self.topology = topology
self.numLabels = numLabels
self.gradientChecking = False
for layer in range(len(self.topology)):
if layer == 0:
... | 39.568182 | 121 | 0.450699 | import numpy as np
class NeuralNetwork(object):
def __init__(self, topology, epsilon, numLabels):
self.theta = []
self.topology = topology
self.numLabels = numLabels
self.gradientChecking = False
for layer in range(len(self.topology)):
if layer == 0:
... | true | true |
f703ae182509e8225f54eb3a2bec3dbf5e9423a8 | 282 | py | Python | chapter09/exercise02.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/exercise02.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/exercise02.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | """“Write a for loop to print all the values in the half_lives list from Operations on Lists, all on a single line. half_lives refers to [87.74, 24110.0, 6537.0, 14.4, 376000.0]."""
half_lives = [87.74, 24110.0, 6537.0, 14.4, 376000.0]
for i in half_lives:
print(i , end=' ') | 56.4 | 183 | 0.677305 |
half_lives = [87.74, 24110.0, 6537.0, 14.4, 376000.0]
for i in half_lives:
print(i , end=' ') | true | true |
f703ae2bb9e374037093786ce006ceb2ba2185c3 | 3,238 | py | Python | swagger_to/bin/swagger_style.py | abingham/swagger-to | a1ef9f46561d39809da0e6ab356427a247815d92 | [
"MIT"
] | 38 | 2018-08-06T15:11:10.000Z | 2022-02-13T22:43:00.000Z | swagger_to/bin/swagger_style.py | abingham/swagger-to | a1ef9f46561d39809da0e6ab356427a247815d92 | [
"MIT"
] | 42 | 2018-08-07T08:25:07.000Z | 2021-11-28T19:32:48.000Z | swagger_to/bin/swagger_style.py | abingham/swagger-to | a1ef9f46561d39809da0e6ab356427a247815d92 | [
"MIT"
] | 16 | 2019-02-26T12:39:43.000Z | 2022-01-29T06:38:41.000Z | #!/usr/bin/env python3
"""Read a correct swagger file and check whether it conforms to a style guide."""
import argparse
import pathlib
from typing import List
import sys
import swagger_to.intermediate
import swagger_to.style
import swagger_to.swagger
def main() -> int:
"""Execute the main routine."""
parse... | 33.381443 | 116 | 0.679432 |
import argparse
import pathlib
from typing import List
import sys
import swagger_to.intermediate
import swagger_to.style
import swagger_to.swagger
def main() -> int:
parser = argparse.ArgumentParser("Reads a correct swagger file and checks that it conforms to the style guide.")
parser.add_argument("--swagg... | true | true |
f703ae464ea3f820d910eceb27441786cfb8c1dd | 12,829 | py | Python | sdk/python/v1beta1/kubeflow/katib/models/v1beta1_experiment_spec.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 1,177 | 2018-04-23T08:45:19.000Z | 2022-03-23T19:09:13.000Z | sdk/python/v1beta1/kubeflow/katib/models/v1beta1_experiment_spec.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 1,791 | 2018-04-20T00:10:17.000Z | 2022-03-31T18:18:36.000Z | sdk/python/v1beta1/kubeflow/katib/models/v1beta1_experiment_spec.py | oneconvergence/katib | 16e0574647ace79ccedd248d072c77139feab5e5 | [
"Apache-2.0"
] | 349 | 2018-04-20T01:03:28.000Z | 2022-03-30T16:11:35.000Z | # coding: utf-8
"""
Katib
Swagger description for Katib # noqa: E501
The version of the OpenAPI document: v1beta1-0.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubeflow.katib.configuration import Configuration
class V1beta1Experiment... | 32.810742 | 303 | 0.654377 |
import pprint
import re
import six
from kubeflow.katib.configuration import Configuration
class V1beta1ExperimentSpec(object):
openapi_types = {
'algorithm': 'V1beta1AlgorithmSpec',
'early_stopping': 'V1beta1EarlyStoppingSpec',
'max_failed_trial_count': 'int',
'max_trial_c... | true | true |
f703ae4c4ee6db57ecd36e86072f030656e6cc07 | 6,325 | py | Python | image-segmentation/data_generators/kitti/kitti_dataset.py | swcho84/image-segmentation | ef9b9b3d832e9efe6f43522cc5ca0e17279d6608 | [
"MIT"
] | 64 | 2019-03-09T08:55:11.000Z | 2022-01-27T07:08:02.000Z | image-segmentation/data_generators/kitti/kitti_dataset.py | swcho84/image-segmentation | ef9b9b3d832e9efe6f43522cc5ca0e17279d6608 | [
"MIT"
] | 2 | 2019-11-07T11:49:13.000Z | 2020-01-16T14:39:03.000Z | image-segmentation/data_generators/kitti/kitti_dataset.py | swcho84/image-segmentation | ef9b9b3d832e9efe6f43522cc5ca0e17279d6608 | [
"MIT"
] | 21 | 2019-03-09T08:56:35.000Z | 2022-03-02T12:24:43.000Z | from collections import namedtuple
import os
import json
import numpy as np
from tqdm import tqdm
from data_generators.utils import load_image_rgb
# Copied from: https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/helpers/labels.py
#
# Cityscapes labels
#
#-------------------------------------... | 43.027211 | 139 | 0.606482 | from collections import namedtuple
import os
import json
import numpy as np
from tqdm import tqdm
from data_generators.utils import load_image_rgb
Label = namedtuple( 'Label' , [
'name' ,
'id' ,
... | true | true |
f703af1b52c4cc4a7f8d2dbe1ec2c5715036e113 | 5,921 | py | Python | pymc4/distributions/tensorflow/continuous.py | byblian/pymc4 | 5de890ed7f22de878eb48c92d3e9b8fe87c25e61 | [
"Apache-2.0"
] | null | null | null | pymc4/distributions/tensorflow/continuous.py | byblian/pymc4 | 5de890ed7f22de878eb48c92d3e9b8fe87c25e61 | [
"Apache-2.0"
] | null | null | null | pymc4/distributions/tensorflow/continuous.py | byblian/pymc4 | 5de890ed7f22de878eb48c92d3e9b8fe87c25e61 | [
"Apache-2.0"
] | null | null | null | """PyMC4 continuous random variables for tensorflow."""
import tensorflow_probability as tfp
from pymc4.distributions import abstract
from pymc4.distributions.tensorflow.distribution import BackendDistribution
tfd = tfp.distributions
__all__ = [
"Beta",
"Cauchy",
"ChiSquared",
"Exponential",
"Gam... | 32.005405 | 98 | 0.694308 | import tensorflow_probability as tfp
from pymc4.distributions import abstract
from pymc4.distributions.tensorflow.distribution import BackendDistribution
tfd = tfp.distributions
__all__ = [
"Beta",
"Cauchy",
"ChiSquared",
"Exponential",
"Gamma",
"Gumbel",
"HalfCauchy",
"HalfNormal",
... | true | true |
f703afa79c2f13ad674c5444dff05b92c244c586 | 5,047 | py | Python | src/datadog/azext_datadog/vendored_sdks/datadog/models/__init__.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2020-09-16T03:47:44.000Z | 2020-09-16T03:47:44.000Z | src/datadog/azext_datadog/vendored_sdks/datadog/models/__init__.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | null | null | null | src/datadog/azext_datadog/vendored_sdks/datadog/models/__init__.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2019-05-02T00:55:30.000Z | 2019-05-02T00:55:30.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 43.886957 | 94 | 0.753913 |
try:
from ._models_py3 import DatadogApiKey
from ._models_py3 import DatadogApiKeyListResponse
from ._models_py3 import DatadogHost
from ._models_py3 import DatadogHostListResponse
from ._models_py3 import DatadogHostMetadata
from ._models_py3 import DatadogInstallMethod
from ._model... | true | true |
f703aff308996d0e92ba59c7db66cb2f74eb84ca | 4,079 | py | Python | vertica_python/vertica/messages/frontend_messages/startup.py | alonme/vertica-python | 208685ce6285bde1edab6d18500ef0887d36bf91 | [
"Apache-2.0"
] | 183 | 2015-01-20T14:57:22.000Z | 2018-08-09T21:13:19.000Z | vertica_python/vertica/messages/frontend_messages/startup.py | alonme/vertica-python | 208685ce6285bde1edab6d18500ef0887d36bf91 | [
"Apache-2.0"
] | 139 | 2015-01-09T18:37:53.000Z | 2018-08-13T07:09:26.000Z | vertica_python/vertica/messages/frontend_messages/startup.py | alonme/vertica-python | 208685ce6285bde1edab6d18500ef0887d36bf91 | [
"Apache-2.0"
] | 110 | 2015-03-02T15:46:11.000Z | 2018-07-27T15:50:29.000Z | # Copyright (c) 2018-2022 Micro Focus or one of its affiliates.
# Copyright (c) 2018 Uber Technologies, 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/licen... | 39.221154 | 94 | 0.694778 |
from __future__ import print_function, division, absolute_import
import platform
import os
from struct import pack
import vertica_python
from ..message import BulkFrontendMessage
class Startup(BulkFrontendMessage):
message_id = None
def __init__(self, user, database, s... | true | true |
f703b03b42284b2d7a546b98872dcbf83ea9965f | 7,279 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_router_setting.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/network/fortios/fortios_router_setting.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/network/fortios/fortios_router_setting.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | 27.467925 | 97 | 0.637862 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_router_setting
short_description... | true | true |
f703b06ebc1168ba15e4a98c0a1b74b76c56faf5 | 1,243 | py | Python | app/file/config/__init__.py | SystemLight/T-fastapi | a1d50f8bdb403939b4d38cbf8113951ae54a0b17 | [
"MIT"
] | null | null | null | app/file/config/__init__.py | SystemLight/T-fastapi | a1d50f8bdb403939b4d38cbf8113951ae54a0b17 | [
"MIT"
] | null | null | null | app/file/config/__init__.py | SystemLight/T-fastapi | a1d50f8bdb403939b4d38cbf8113951ae54a0b17 | [
"MIT"
] | null | null | null | import os
import posixpath
from enum import Enum
from fastapi import Path, HTTPException
from utils import security
class UploadPath(str, Enum):
default = "default"
UPLOAD_PATH_DICT = {
UploadPath.default: "default/"
}
def get_upload(upload_key: UploadPath = Path(..., description="上传文件块位置")):
"""
... | 18.833333 | 80 | 0.665326 | import os
import posixpath
from enum import Enum
from fastapi import Path, HTTPException
from utils import security
class UploadPath(str, Enum):
default = "default"
UPLOAD_PATH_DICT = {
UploadPath.default: "default/"
}
def get_upload(upload_key: UploadPath = Path(..., description="上传文件块位置")):
root_p... | true | true |
f703b19dc731fc9829fbf4343624e5debf96ab76 | 2,254 | py | Python | var/spack/repos/builtin/packages/repeatmodeler/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/repeatmodeler/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/repeatmodeler/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Repeatmodeler(Package):
"""RepeatModeler is a de-novo repeat family identification and mod... | 33.641791 | 96 | 0.582076 |
from spack import *
class Repeatmodeler(Package):
homepage = "http://www.repeatmasker.org/RepeatModeler/"
url = "http://www.repeatmasker.org/RepeatModeler/RepeatModeler-open-1.0.11.tar.gz"
version('1.0.11', sha256='7ff0d588b40f9ad5ce78876f3ab8d2332a20f5128f6357413f741bb7fa172193')
depends... | true | true |
f703b1b06e104a60a7e9c722a084a851230c80a8 | 421 | py | Python | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Conceitos básicos/Exercício 1) H.py | sullyvan15/UVV | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | null | null | null | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Conceitos básicos/Exercício 1) H.py | sullyvan15/UVV | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | 1 | 2020-10-07T23:33:21.000Z | 2020-10-08T01:15:11.000Z | 4° Período/Programação de Computadores/lista 1/CONCEITOS DE LÓGICA DE PROGRAMAÇÃO/Conceitos básicos/Exercício 1) H.py | sullyvan15/Universidade-Vila-Velha | 2390cc2881792d036db1d8b098fe366f47cd98c3 | [
"MIT"
] | null | null | null |
import math
pi = math.pi
raio = float(input('Qual é o raio da esfera?: '))
volume_esf = 4/3*pi*math.pow(raio, 3)
litro = 1
lata = litro*5
precolata = 50.00
totaltinta = volume_esf *lata
totalpreco = totaltinta * precolata
print(f'O volume da esfera é {volume_esf: .2f}')
print(f'A quantidade de tinta necessária é... | 19.136364 | 73 | 0.700713 |
import math
pi = math.pi
raio = float(input('Qual é o raio da esfera?: '))
volume_esf = 4/3*pi*math.pow(raio, 3)
litro = 1
lata = litro*5
precolata = 50.00
totaltinta = volume_esf *lata
totalpreco = totaltinta * precolata
print(f'O volume da esfera é {volume_esf: .2f}')
print(f'A quantidade de tinta necessária é... | true | true |
f703b74ac5d58a4ebdf04bf28c7ab476758aa9d5 | 9,599 | py | Python | tests/test_notify_slack.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 5 | 2021-02-04T01:07:20.000Z | 2021-04-16T09:35:21.000Z | tests/test_notify_slack.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 252 | 2020-10-26T10:34:43.000Z | 2021-05-17T04:21:08.000Z | tests/test_notify_slack.py | linz/geospatial-data-lake | e92fb2fc0e050da471e3ecbc1c0331c551612092 | [
"MIT"
] | 1 | 2021-05-05T04:23:32.000Z | 2021-05-05T04:23:32.000Z | from datetime import datetime, timezone
from http import HTTPStatus
from json import dumps, load
from logging import getLogger
from os import environ
from unittest.mock import MagicMock, patch
from mypy_boto3_events import EventBridgeClient
from mypy_boto3_lambda import LambdaClient
from mypy_boto3_sns.type_defs impor... | 34.405018 | 95 | 0.679446 | from datetime import datetime, timezone
from http import HTTPStatus
from json import dumps, load
from logging import getLogger
from os import environ
from unittest.mock import MagicMock, patch
from mypy_boto3_events import EventBridgeClient
from mypy_boto3_lambda import LambdaClient
from mypy_boto3_sns.type_defs impor... | true | true |
f703bac82a9f2a7e37f961023a6241cdb63ca46d | 458 | py | Python | lib/twl.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | null | null | null | lib/twl.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | 37 | 2020-03-22T23:21:14.000Z | 2020-09-16T15:07:06.000Z | lib/twl.py | riandakarizal/ITeung | 2d3fc7e4974c9a9b67ff61f2a77a528988b55820 | [
"MIT"
] | 1 | 2020-09-08T11:31:30.000Z | 2020-09-08T11:31:30.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 08:55:39 2020
@author: rolly
"""
import config
from twilio.rest import Client
#https://api.whatsapp.com/send?phone=14155238886&text=join%20actual-nor&source=&data=
def sendMsg(num,msg):
client = Client(config.account_sid, config.auth_token)
message = client.m... | 24.105263 | 85 | 0.657205 |
import config
from twilio.rest import Client
def sendMsg(num,msg):
client = Client(config.account_sid, config.auth_token)
message = client.messages.create(
to="whatsapp:+"+num,
from_="whatsapp:+14155238886",
body=msg)
print(message.sid)
| true | true |
f703bb46c6369210b5bbac4b3c528d3ee60d82b6 | 1,416 | py | Python | aws_lambda_powertools/utilities/parser/envelopes/sns.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | aws_lambda_powertools/utilities/parser/envelopes/sns.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | aws_lambda_powertools/utilities/parser/envelopes/sns.py | n2N8Z/aws-lambda-powertools-python | 0cb5d506f534ac76b42f2d5959d93c7b2bb4d8e9 | [
"MIT-0"
] | null | null | null | import logging
from typing import Any, Dict, List, Optional, Union
from ..models import SnsModel
from ..types import Model
from .base import BaseEnvelope
logger = logging.getLogger(__name__)
class SnsEnvelope(BaseEnvelope):
"""SNS Envelope to extract array of Records
The record's body parameter is a string... | 32.930233 | 103 | 0.655367 | import logging
from typing import Any, Dict, List, Optional, Union
from ..models import SnsModel
from ..types import Model
from .base import BaseEnvelope
logger = logging.getLogger(__name__)
class SnsEnvelope(BaseEnvelope):
def parse(self, data: Optional[Union[Dict[str, Any], Any]], model: Model) -> List[Optio... | true | true |
f703bc9d08a5ff497c1674f4e927bd52424324e7 | 6,522 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_datacenter.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/cloud/vmware/vmware_datacenter.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/cloud/vmware/vmware_datacenter.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
... | 38.364706 | 109 | 0.58939 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: vmware_datacenter
short_description: Manage VMware vSphere Datacenters
descripti... | true | true |
f703bdae29f09a662a7398ff7215e7e7a58112a9 | 1,142 | py | Python | quick_reports_demo/blog/migrations/0001_initial.py | brsbilgic/django-quick-reports | d69a532711d23f3640874c1c5fcacdbe328c6805 | [
"MIT"
] | 7 | 2015-07-12T14:45:18.000Z | 2020-12-25T04:38:22.000Z | quick_reports_demo/blog/migrations/0001_initial.py | brsbilgic/django_jooy_reporting | d69a532711d23f3640874c1c5fcacdbe328c6805 | [
"MIT"
] | 1 | 2021-03-19T21:49:50.000Z | 2021-03-19T21:49:50.000Z | quick_reports_demo/blog/migrations/0001_initial.py | brsbilgic/django-quick-reports | d69a532711d23f3640874c1c5fcacdbe328c6805 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | 34.606061 | 114 | 0.590193 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.... | true | true |
f703be8eb9c4bf6ae4bb900027692d9f03afd640 | 4,804 | py | Python | third_party/py/gflags/gflags/flags_modules_for_testing/module_bar.py | sevki/bazel | b18915752a69fbbc6ed94e1710198167593565fc | [
"Apache-2.0"
] | 218 | 2015-04-01T07:12:40.000Z | 2021-12-28T05:02:06.000Z | third_party/py/gflags/gflags/flags_modules_for_testing/module_bar.py | sevki/bazel | b18915752a69fbbc6ed94e1710198167593565fc | [
"Apache-2.0"
] | 67 | 2022-01-12T18:22:13.000Z | 2022-01-12T18:24:28.000Z | third_party/py/gflags/gflags/flags_modules_for_testing/module_bar.py | sevki/bazel | b18915752a69fbbc6ed94e1710198167593565fc | [
"Apache-2.0"
] | 72 | 2015-04-01T07:12:41.000Z | 2021-10-21T00:36:27.000Z | #!/usr/bin/env python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of c... | 35.323529 | 72 | 0.720025 |
__author__ = 'salcianu@google.com (Alex Salcianu)'
import gflags
from gflags import _helpers
FLAGS = gflags.FLAGS
def DefineFlags(flag_values=FLAGS):
gflags.DEFINE_boolean('tmod_bar_x', True, 'Boolean flag.',
flag_values=flag_values)
gflags.DEFINE_stri... | true | true |
f703bef3cc58393e1a48a25c34a53fe8a2773f4a | 603 | py | Python | pluto/control/modes/live_mode.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/control/modes/live_mode.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/control/modes/live_mode.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | from pluto.control.modes import mode
from pluto.control.modes.processes import process_manager
from protos import broker_pb2_grpc
class LiveControlMode(mode.ControlCommandHandler):
def __init__(self, server, framework_url, process_factory):
super(LiveControlMode, self).__init__(framework_url, process_fact... | 33.5 | 77 | 0.772803 | from pluto.control.modes import mode
from pluto.control.modes.processes import process_manager
from protos import broker_pb2_grpc
class LiveControlMode(mode.ControlCommandHandler):
def __init__(self, server, framework_url, process_factory):
super(LiveControlMode, self).__init__(framework_url, process_fact... | true | true |
f703c0dd2d885c53936772b4024a7a0e280f7489 | 1,998 | py | Python | docs/conf.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 15 | 2016-09-19T12:06:12.000Z | 2021-11-30T12:04:44.000Z | docs/conf.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 22 | 2017-06-19T18:13:54.000Z | 2021-05-28T09:25:01.000Z | docs/conf.py | Hiteshsuhas/err-stackstorm | 7579350ac50d9324b64a73b86d57e094270cb275 | [
"Apache-2.0"
] | 7 | 2017-06-19T17:03:59.000Z | 2021-09-27T11:06:31.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 34.448276 | 79 | 0.667167 |
project = 'err-stackstorm'
copyright = '2019, err-stackstorm contributors'
author = 'err-stackstorm contributors'
release = '2.1.4'
master_doc = "index"
extensions = [
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme = "sphinx... | true | true |
f703c31023fc04137e38d2d20e70db35d5885d77 | 19,181 | py | Python | tests/devices/test_default_qubit_jax.py | pearcandy/pennylane | dfa35989cd0798496e41999a197bcf0eb26185df | [
"Apache-2.0"
] | null | null | null | tests/devices/test_default_qubit_jax.py | pearcandy/pennylane | dfa35989cd0798496e41999a197bcf0eb26185df | [
"Apache-2.0"
] | null | null | null | tests/devices/test_default_qubit_jax.py | pearcandy/pennylane | dfa35989cd0798496e41999a197bcf0eb26185df | [
"Apache-2.0"
] | null | null | null | import pytest
jax = pytest.importorskip("jax", minversion="0.2")
jnp = jax.numpy
import numpy as np
import pennylane as qml
from pennylane.devices.default_qubit_jax import DefaultQubitJax
pytestmark = pytest.mark.usefixtures("tape_mode")
class TestQNodeIntegration:
"""Integration tests for default.q... | 38.671371 | 105 | 0.57265 | import pytest
jax = pytest.importorskip("jax", minversion="0.2")
jnp = jax.numpy
import numpy as np
import pennylane as qml
from pennylane.devices.default_qubit_jax import DefaultQubitJax
pytestmark = pytest.mark.usefixtures("tape_mode")
class TestQNodeIntegration:
def test_defines_correct_capabil... | true | true |
f703c319ac98938777a90feb59bfeb1ef81ebb42 | 2,199 | py | Python | src/pytest_mock_resources/fixture/database/relational/redshift/__init__.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 49 | 2020-01-24T21:08:43.000Z | 2022-03-31T23:55:21.000Z | src/pytest_mock_resources/fixture/database/relational/redshift/__init__.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 29 | 2020-03-11T19:07:50.000Z | 2022-03-30T16:49:06.000Z | src/pytest_mock_resources/fixture/database/relational/redshift/__init__.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 10 | 2020-01-23T19:04:09.000Z | 2022-02-22T19:57:54.000Z | import pytest
from pytest_mock_resources.fixture.database.generic import assign_fixture_credentials
from pytest_mock_resources.fixture.database.relational.generic import EngineManager
from pytest_mock_resources.fixture.database.relational.postgresql import (
_create_clean_database,
get_sqlalchemy_engine,
)
fro... | 39.267857 | 95 | 0.729877 | import pytest
from pytest_mock_resources.fixture.database.generic import assign_fixture_credentials
from pytest_mock_resources.fixture.database.relational.generic import EngineManager
from pytest_mock_resources.fixture.database.relational.postgresql import (
_create_clean_database,
get_sqlalchemy_engine,
)
fro... | true | true |
f703c343b85bbcb32c648a5f8668d2512894a13a | 2,586 | py | Python | IMLearn/learners/regressors/polynomial_fitting.py | RotemBadash/IML.HUJI | 2b20d074c159123f61b321a7e84312ab82400949 | [
"MIT"
] | null | null | null | IMLearn/learners/regressors/polynomial_fitting.py | RotemBadash/IML.HUJI | 2b20d074c159123f61b321a7e84312ab82400949 | [
"MIT"
] | null | null | null | IMLearn/learners/regressors/polynomial_fitting.py | RotemBadash/IML.HUJI | 2b20d074c159123f61b321a7e84312ab82400949 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import NoReturn
from . import LinearRegression
from ...base import BaseEstimator
import numpy as np
class PolynomialFitting(BaseEstimator):
"""
Polynomial Fitting using Least Squares estimation
"""
def __init__(self, k: int) -> PolynomialFitting:
... | 28.108696 | 68 | 0.5785 | from __future__ import annotations
from typing import NoReturn
from . import LinearRegression
from ...base import BaseEstimator
import numpy as np
class PolynomialFitting(BaseEstimator):
def __init__(self, k: int) -> PolynomialFitting:
super().__init__()
self.degree = k
self.linear_regress... | true | true |
f703c645aa7c72fe4e04cdbf60f8a8cc84e7b617 | 1,238 | py | Python | alipay/aop/api/domain/PriceInformation.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/PriceInformation.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/PriceInformation.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class PriceInformation(object):
def __init__(self):
self._amount = None
self._type = None
@property
def amount(self):
return self._amount
@amount.setter
def am... | 22.107143 | 63 | 0.53958 |
import json
from alipay.aop.api.constant.ParamConstants import *
class PriceInformation(object):
def __init__(self):
self._amount = None
self._type = None
@property
def amount(self):
return self._amount
@amount.setter
def amount(self, value):
self._amount = va... | true | true |
f703c684e0729337f837439e10d1d599b1cb1d38 | 8,121 | py | Python | tests/unit/controllers/api/v1/test_traces_rbac.py | ankita-orchestral/st2-rbac-backend | c90191dd1ff126362f9fdecca0fa1b694288641f | [
"Apache-2.0"
] | 1 | 2020-09-21T16:05:31.000Z | 2020-09-21T16:05:31.000Z | tests/unit/controllers/api/v1/test_traces_rbac.py | ankita-orchestral/st2-rbac-backend | c90191dd1ff126362f9fdecca0fa1b694288641f | [
"Apache-2.0"
] | 18 | 2020-09-18T19:07:03.000Z | 2022-02-25T07:02:17.000Z | tests/unit/controllers/api/v1/test_traces_rbac.py | ankita-orchestral/st2-rbac-backend | c90191dd1ff126362f9fdecca0fa1b694288641f | [
"Apache-2.0"
] | 4 | 2020-08-27T12:24:51.000Z | 2021-09-22T10:09:18.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright (C) 2020 Extreme Networks, Inc - All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | 44.377049 | 95 | 0.695111 |
import six
from st2common.rbac.types import PermissionType
from st2common.rbac.types import ResourceType
from st2common.persistence.auth import User
from st2common.persistence.rbac import Role
from st2common.persistence.rbac import UserRoleAssignment
from st2common.persistence.rbac import PermissionGran... | true | true |
f703c79631f36821717c501608afedc68f7f2caf | 154 | py | Python | Lesson_2.py | Justmove08/Lesson_2 | 8f88619c0bf0140be9f4b8e24f7a7852758de55a | [
"MIT"
] | null | null | null | Lesson_2.py | Justmove08/Lesson_2 | 8f88619c0bf0140be9f4b8e24f7a7852758de55a | [
"MIT"
] | null | null | null | Lesson_2.py | Justmove08/Lesson_2 | 8f88619c0bf0140be9f4b8e24f7a7852758de55a | [
"MIT"
] | null | null | null | import requests
import json
url = "https://www.cbr-xml-daily.ru/daily_json.js"
response = requests.get(url)
data = json.loads(response.text)
print(data)
| 19.25 | 50 | 0.753247 | import requests
import json
url = "https://www.cbr-xml-daily.ru/daily_json.js"
response = requests.get(url)
data = json.loads(response.text)
print(data)
| true | true |
f703c7f57d121c0c204bdc8eea1d7ea29ffacb56 | 727 | py | Python | authors/apps/reports/models.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 3 | 2019-05-01T10:41:09.000Z | 2021-04-25T22:17:20.000Z | authors/apps/reports/models.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 24 | 2019-04-23T14:56:21.000Z | 2021-12-13T19:58:37.000Z | authors/apps/reports/models.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 4 | 2019-06-29T10:40:32.000Z | 2022-01-04T11:44:53.000Z | from django.db import models
from authors import settings
from authors.apps.articles.models import Article
from authors.apps.profiles.models import Profile
# Create your models here.
class ReportArticle(models.Model):
"""model for reporting an article"""
reporter = models.ForeignKey(Profile, on_delete=models.C... | 45.4375 | 83 | 0.779917 | from django.db import models
from authors import settings
from authors.apps.articles.models import Article
from authors.apps.profiles.models import Profile
class ReportArticle(models.Model):
reporter = models.ForeignKey(Profile, on_delete=models.CASCADE)
article = models.ForeignKey(Article, to_field="slug", o... | true | true |
f703c8360e791059085f84845e7382a4d897f455 | 3,203 | py | Python | code_demo/python_framework/3_app_class.py | PegasusWang/notebooks | 78a88de2ed2e858d3b1f997d0e5155a37e70b82c | [
"MIT"
] | 38 | 2018-02-14T05:40:17.000Z | 2021-09-26T10:14:57.000Z | code_demo/python_framework/3_app_class.py | PegasusWang/notebooks | 78a88de2ed2e858d3b1f997d0e5155a37e70b82c | [
"MIT"
] | null | null | null | code_demo/python_framework/3_app_class.py | PegasusWang/notebooks | 78a88de2ed2e858d3b1f997d0e5155a37e70b82c | [
"MIT"
] | 11 | 2018-02-13T22:52:59.000Z | 2020-07-14T04:04:54.000Z | # -*- coding: utf-8 -*-
import re
from six.moves import http_client
from six.moves import urllib
from wsgiref.headers import Headers
class Request(object):
def __init__(self, environ):
self.environ = environ
@property
def path(self):
return self.environ['PATH_INFO']
@property
de... | 27.612069 | 109 | 0.634093 |
import re
from six.moves import http_client
from six.moves import urllib
from wsgiref.headers import Headers
class Request(object):
def __init__(self, environ):
self.environ = environ
@property
def path(self):
return self.environ['PATH_INFO']
@property
def args(self):
g... | true | true |
f703c881bdbf9a59f2cf3170b2e0a56ebc6c9201 | 9,841 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_ips_rule_settings.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_ips_rule_settings.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/fortios/fortios_ips_rule_settings.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | 29.641566 | 99 | 0.612031 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_ips_rule_settings
short_description... | true | true |
f703ca77a30ca7350baf7d44bc4292d83426e83a | 392 | py | Python | MyModule.py | LvJC/cpp-libtorch | 4a56dda616bde50423591e7a4d4d7be6a978f6bf | [
"Apache-2.0"
] | 1 | 2020-03-05T10:07:44.000Z | 2020-03-05T10:07:44.000Z | MyModule.py | LvJC/cpp-libtorch | 4a56dda616bde50423591e7a4d4d7be6a978f6bf | [
"Apache-2.0"
] | 1 | 2020-06-23T14:05:29.000Z | 2020-06-23T14:05:29.000Z | MyModule.py | LvJC/cpp-libtorch | 4a56dda616bde50423591e7a4d4d7be6a978f6bf | [
"Apache-2.0"
] | 1 | 2019-12-19T14:01:28.000Z | 2019-12-19T14:01:28.000Z | import torch
import torchvision
# An instance of your model.
model = torchvision.models.resnet18()
# An example input you would normally provide to your model's forward() method.
example = torch.rand(1, 3, 224, 224)
# Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing.
traced_script_module = torch.... | 26.133333 | 79 | 0.770408 | import torch
import torchvision
model = torchvision.models.resnet18()
example = torch.rand(1, 3, 224, 224)
# Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing.
traced_script_module = torch.jit.trace(model, example)
# save
traced_script_module.save("model.pt")
| true | true |
f703cad52db07a4720007227ed997cccd7842588 | 3,153 | py | Python | zerver/lib/dev_ldap_directory.py | ross-sysadm/zulip | 674158b8170eddb71aa2210052f0d598752581ed | [
"Apache-2.0"
] | null | null | null | zerver/lib/dev_ldap_directory.py | ross-sysadm/zulip | 674158b8170eddb71aa2210052f0d598752581ed | [
"Apache-2.0"
] | null | null | null | zerver/lib/dev_ldap_directory.py | ross-sysadm/zulip | 674158b8170eddb71aa2210052f0d598752581ed | [
"Apache-2.0"
] | null | null | null | import glob
import logging
import os
from typing import Any, Dict, List, Optional
from django.conf import settings
from zerver.lib.storage import static_path
# See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/
# for docs on what these values mean.
LDAP_USER_ACCOUNT_CONTROL_NORMAL = '512'... | 38.925926 | 99 | 0.625119 | import glob
import logging
import os
from typing import Any, Dict, List, Optional
from django.conf import settings
from zerver.lib.storage import static_path
LDAP_USER_ACCOUNT_CONTROL_NORMAL = '512'
LDAP_USER_ACCOUNT_CONTROL_DISABLED = '514'
def generate_dev_ldap_dir(mode: str, num_users: int=8) -> Dict[str, Dict... | true | true |
f703cb62e2704a49458ad5c25825835775dc1de1 | 6,656 | py | Python | yatube/posts/views.py | VladimirDip/Yatube | 2652bd1e73677ec6d10e7fd1153f65fa48ee8a35 | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/views.py | VladimirDip/Yatube | 2652bd1e73677ec6d10e7fd1153f65fa48ee8a35 | [
"BSD-3-Clause"
] | null | null | null | yatube/posts/views.py | VladimirDip/Yatube | 2652bd1e73677ec6d10e7fd1153f65fa48ee8a35 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import AnonymousUser
from django.core.paginator import Paginator
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.views.decorators.cache import cache_page
from django... | 39.856287 | 93 | 0.629207 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import AnonymousUser
from django.core.paginator import Paginator
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.views.decorators.cache import cache_page
from django... | true | true |
f703cb77ea9e43fc26b5d0b603d2a528e44aeee5 | 1,608 | py | Python | extviews/connections.py | BilalAlpaslan/fastapi-extviews | e3ce1c4916d86009705a09e165e5ee21a197962f | [
"MIT"
] | 16 | 2022-01-01T16:00:58.000Z | 2022-03-21T09:42:35.000Z | extviews/connections.py | BilalAlpaslan/fastapi-extviews | e3ce1c4916d86009705a09e165e5ee21a197962f | [
"MIT"
] | null | null | null | extviews/connections.py | BilalAlpaslan/fastapi-extviews | e3ce1c4916d86009705a09e165e5ee21a197962f | [
"MIT"
] | null | null | null |
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo import MongoClient
__all__ = ['PymongoConnection', 'MotorConnection']
class PymongoConnection:
def __init__(self, host="127.0.0.1", port="27017", db="default", user=None, password=None):
"""Create database connection."""
if user and... | 32.816327 | 95 | 0.626866 |
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo import MongoClient
__all__ = ['PymongoConnection', 'MotorConnection']
class PymongoConnection:
def __init__(self, host="127.0.0.1", port="27017", db="default", user=None, password=None):
if user and password:
self.db_client = Mo... | true | true |
f703cbd34235ec29b24264756ef19d8f43b8582f | 13,776 | py | Python | env/lib/python3.8/site-packages/docker/utils/utils.py | projeto-de-algoritmos/Grafos2_IMDBConnection | 5bcd9a631f6d871d2d9d3038a9904b9e930ac64a | [
"MIT"
] | 1 | 2021-10-04T18:22:12.000Z | 2021-10-04T18:22:12.000Z | env/lib/python3.8/site-packages/docker/utils/utils.py | projeto-de-algoritmos/Grafos2_IMDBConnection | 5bcd9a631f6d871d2d9d3038a9904b9e930ac64a | [
"MIT"
] | 10 | 2021-06-16T20:48:32.000Z | 2021-10-04T18:22:02.000Z | env/lib/python3.8/site-packages/docker/utils/utils.py | projeto-de-algoritmos/Grafos2_IMDBConnection | 5bcd9a631f6d871d2d9d3038a9904b9e930ac64a | [
"MIT"
] | null | null | null | import base64
import json
import os
import os.path
import shlex
import string
from datetime import datetime
from distutils.version import StrictVersion
from .. import errors
from .. import tls
from ..constants import DEFAULT_HTTP_HOST
from ..constants import DEFAULT_UNIX_SOCKET
from ..constants import DEFAULT_NPIPE
fr... | 27.830303 | 78 | 0.564387 | import base64
import json
import os
import os.path
import shlex
import string
from datetime import datetime
from distutils.version import StrictVersion
from .. import errors
from .. import tls
from ..constants import DEFAULT_HTTP_HOST
from ..constants import DEFAULT_UNIX_SOCKET
from ..constants import DEFAULT_NPIPE
fr... | true | true |
f703cbd8080c7a50635529e13a3dc9a8386266d3 | 13,462 | py | Python | airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-29T01:08:58.000Z | 2022-03-29T01:08:58.000Z | airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 5 | 2022-02-22T14:49:48.000Z | 2022-03-19T10:43:08.000Z | airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-11T06:21:24.000Z | 2022-03-11T06:21:24.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
# generated by datamodel-codegen:
# filename: airbyte_protocol.yaml
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from pydantic import AnyUrl, BaseModel, Extra, Field
class Type(Enum):
... | 53 | 1,333 | 0.726267 |
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional, Union
from pydantic import AnyUrl, BaseModel, Extra, Field
class Type(Enum):
RECORD = "RECORD"
STATE = "STATE"
LOG = "LOG"
SPEC = "SPEC"
CONNECTION_STATUS = "CONNECTION_STATUS"
CATAL... | true | true |
f703cc16c1bc121575b31193db24ab7d64ed8f56 | 3,337 | py | Python | app/waypointapp.py | shinwachi/waypointapp | c7a5f8fda76b64fc0a8124bf5737dab2ca7e8301 | [
"MIT",
"Unlicense"
] | null | null | null | app/waypointapp.py | shinwachi/waypointapp | c7a5f8fda76b64fc0a8124bf5737dab2ca7e8301 | [
"MIT",
"Unlicense"
] | null | null | null | app/waypointapp.py | shinwachi/waypointapp | c7a5f8fda76b64fc0a8124bf5737dab2ca7e8301 | [
"MIT",
"Unlicense"
] | null | null | null | import os, collections, sqlite3
from flask import Flask, render_template
from flask.ext.bootstrap import Bootstrap
from AsciiDammit import asciiDammit
app = Flask(__name__)
bootstrap = Bootstrap(app)
import util as wpu
configDict = {}
appDataDirDict = {}
appName = "waypointapp"
@app.route('/')
def index():
appName... | 36.271739 | 212 | 0.712017 | import os, collections, sqlite3
from flask import Flask, render_template
from flask.ext.bootstrap import Bootstrap
from AsciiDammit import asciiDammit
app = Flask(__name__)
bootstrap = Bootstrap(app)
import util as wpu
configDict = {}
appDataDirDict = {}
appName = "waypointapp"
@app.route('/')
def index():
appName... | true | true |
f703ce91cf2543bf6e32692a3a3e81e02753760e | 7,646 | py | Python | python/deepLearningTorch.py | demarley/leopard | 52c5eb2dd732798972d429887c273f8449039c8f | [
"MIT"
] | null | null | null | python/deepLearningTorch.py | demarley/leopard | 52c5eb2dd732798972d429887c273f8449039c8f | [
"MIT"
] | 1 | 2018-08-26T16:48:47.000Z | 2018-08-26T16:48:47.000Z | python/deepLearningTorch.py | demarley/leopard | 52c5eb2dd732798972d429887c273f8449039c8f | [
"MIT"
] | 1 | 2018-09-06T07:57:03.000Z | 2018-09-06T07:57:03.000Z | """
Created: 16 August 2018
Last Updated: 16 August 2018
Dan Marley
daniel.edison.marley@cernSPAMNOT.ch
Texas A&M University
-----
Class for performing deep learning in pytorch
Designed for running on desktop at TAMU
with specific set of software installed
--> not guaranteed to work in CMSSW environment!
D... | 34.913242 | 132 | 0.615747 | import json
import util
import datetime
import collections
from deepLearning import DeepLearning
import uproot
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as tf
from torch.autograd import Variable
from sklearn.model_selection import StratifiedKFold
from sklea... | true | true |
f703ced66ac13bee7f8100c8b3e3b18e720c8fc6 | 793 | py | Python | core/csrc/torch_nndistance/test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | core/csrc/torch_nndistance/test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | core/csrc/torch_nndistance/test.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | import torch
import os.path as osp
import sys
from torch.autograd import Variable
cur_dir = osp.dirname(osp.abspath(__file__))
sys.path.insert(0, cur_dir)
import torch_nndistance as NND
p1 = torch.rand(10, 1000, 3)
p2 = torch.rand(10, 1500, 3)
points1 = Variable(p1, requires_grad=True)
points2 = p2
points1 = points1... | 23.323529 | 49 | 0.725095 | import torch
import os.path as osp
import sys
from torch.autograd import Variable
cur_dir = osp.dirname(osp.abspath(__file__))
sys.path.insert(0, cur_dir)
import torch_nndistance as NND
p1 = torch.rand(10, 1000, 3)
p2 = torch.rand(10, 1500, 3)
points1 = Variable(p1, requires_grad=True)
points2 = p2
points1 = points1... | true | true |
f703cfe3cdfc3e3b298ee7f07fe599e74fbf88d9 | 1,608 | py | Python | linesman/geo.py | burrscurr/linesman | ace4b38ac54e2cec29e49023cb725afe040c017a | [
"MIT"
] | 3 | 2021-01-05T21:00:26.000Z | 2021-01-26T00:08:26.000Z | linesman/geo.py | burrscurr/linesman | ace4b38ac54e2cec29e49023cb725afe040c017a | [
"MIT"
] | 47 | 2021-01-04T17:31:26.000Z | 2022-02-14T04:03:47.000Z | linesman/geo.py | burrscurr/linesman | ace4b38ac54e2cec29e49023cb725afe040c017a | [
"MIT"
] | 1 | 2021-01-05T21:02:23.000Z | 2021-01-05T21:02:23.000Z | from geographiclib.geodesic import Geodesic
from pyproj import CRS, Transformer
from .geometry import Vector, Line
def azimuth(p1: Vector, p2: Vector):
""":return: azimuth of geodesic through p1 and p2 in p1 with WGS84"""
res = Geodesic.WGS84.Inverse(p1.y, p1.x, p2.y, p2.x)
return res['azi1']
def dist... | 35.733333 | 79 | 0.670398 | from geographiclib.geodesic import Geodesic
from pyproj import CRS, Transformer
from .geometry import Vector, Line
def azimuth(p1: Vector, p2: Vector):
res = Geodesic.WGS84.Inverse(p1.y, p1.x, p2.y, p2.x)
return res['azi1']
def dist_m(a, b):
res = Geodesic.WGS84.Inverse(a.y, a.x, b.y, b.x)
return ... | true | true |
f703d29d936bbe5b59762ca968f7b33cb9db5fbd | 1,466 | py | Python | WEEKS/CD_Sata-Structures/_MISC/algorithms/tree/segment_tree/segment_tree.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 11 | 2021-02-18T04:53:44.000Z | 2022-01-16T10:57:39.000Z | WEEKS/CD_Sata-Structures/_MISC/algorithms/tree/segment_tree/segment_tree.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 162 | 2021-03-09T01:52:11.000Z | 2022-03-12T01:09:07.000Z | WEEKS/CD_Sata-Structures/_MISC/algorithms/tree/segment_tree/segment_tree.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 8 | 2021-02-18T05:12:34.000Z | 2022-03-06T19:02:14.000Z | """
Segment_tree creates a segment tree with a given array and function,
allowing queries to be done later in log(N) time
function takes 2 values and returns a same type value
"""
class SegmentTree:
def __init__(self, arr, function):
self.segment = [0 for x in range(3 * len(arr) + 3)]
self.arr = a... | 28.192308 | 87 | 0.514325 |
class SegmentTree:
def __init__(self, arr, function):
self.segment = [0 for x in range(3 * len(arr) + 3)]
self.arr = arr
self.fn = function
self.maketree(0, 0, len(arr) - 1)
def make_tree(self, i, l, r):
if l == r:
self.segment[i] = self.arr[l]
elif... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.