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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7109ecc06eaa292a20f8a9fb4dbb062ffca45f0 | 610 | py | Python | scripts/emnist_viz_tf.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 4,895 | 2016-08-17T22:28:34.000Z | 2022-03-31T17:07:15.000Z | scripts/emnist_viz_tf.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 446 | 2016-09-17T14:35:29.000Z | 2022-03-31T19:59:33.000Z | scripts/emnist_viz_tf.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 1,160 | 2016-08-18T23:19:27.000Z | 2022-03-31T12:44:07.000Z |
import superimport
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
import tensorflow as tf
import tensorflow_datasets as tfds
np.random.seed(0)
ds, info = tfds.load('emnist', split='test', shuffle_files=False, with_info=True) # horribly slow
print(info)
plt.figure(figsize=(10, 1... | 17.941176 | 97 | 0.67541 |
import superimport
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
import tensorflow as tf
import tensorflow_datasets as tfds
np.random.seed(0)
ds, info = tfds.load('emnist', split='test', shuffle_files=False, with_info=True)
print(info)
plt.figure(figsize=(10, 10))
i = 0
for e... | true | true |
f7109fd83a9537b7def6232027ba5416b1f71200 | 1,156 | py | Python | scraper/storage_spiders/lingovn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/lingovn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/lingovn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1[@itemprop='name']",
'price' : "//div[@class='div-new-price']/span[@class='new-price']",
'category' : "//span[@class='item']/a... | 38.533333 | 93 | 0.614187 |
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1[@itemprop='name']",
'price' : "//div[@class='div-new-price']/span[@class='new-price']",
'category' : "//span[@class='item']/a[@itemprop='url']/span[@itemprop='title']",
'description' : "//div[@clas... | true | true |
f710a02aacb223fde4921f89cbd938a26a27feb5 | 24,506 | py | Python | src/Interpolator.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | 1 | 2020-10-21T15:32:41.000Z | 2020-10-21T15:32:41.000Z | src/Interpolator.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | null | null | null | src/Interpolator.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | null | null | null | import numpy as np
from sympy import *
def interpolate_cubic(p1, p2, k_traj, t):
'''
Computes a smooth cubic polynomail between 2 N-dimensional points
Input:
p1: Nx1 numpy array the first point
p2: Nx1 numpy array the second point
... | 39.08453 | 118 | 0.548437 | import numpy as np
from sympy import *
def interpolate_cubic(p1, p2, k_traj, t):
assert type(p1) == np.ndarray and type(p2) == np.ndarray
assert type(k_traj) == int and (type(t) == float or type(t) == int)
traj_list = []
dtraj_list = []
ddtraj_list = []
dddtraj_list = []
s, ds, dds, ddds... | true | true |
f710a0470414947a43cf7b958d2cdc1f201c32b2 | 1,346 | py | Python | model/NoobSender.py | adhocmaster/netmad | fe6c115d71ebeb8c689cdd1b8bed80ac35757681 | [
"MIT"
] | null | null | null | model/NoobSender.py | adhocmaster/netmad | fe6c115d71ebeb8c689cdd1b8bed80ac35757681 | [
"MIT"
] | null | null | null | model/NoobSender.py | adhocmaster/netmad | fe6c115d71ebeb8c689cdd1b8bed80ac35757681 | [
"MIT"
] | null | null | null | from model.Sender import Sender
from model.SenderType import SenderType
import logging
import math
import numpy as np
class NoobSender(Sender):
def __init__(self, id, deliveryRate, debug=True):
super().__init__(id, SenderType.Noob, deliveryRate=deliveryRate, debug=debug)
def getNumberOfPacketsToCreat... | 28.041667 | 104 | 0.601783 | from model.Sender import Sender
from model.SenderType import SenderType
import logging
import math
import numpy as np
class NoobSender(Sender):
def __init__(self, id, deliveryRate, debug=True):
super().__init__(id, SenderType.Noob, deliveryRate=deliveryRate, debug=debug)
def getNumberOfPacketsToCreat... | true | true |
f710a0c8b136ab0cad55d6b46cb18b57d9494789 | 3,849 | py | Python | customer_selection_line.py | pgmoka/checkout-simulator | bce7e68ba47b9309f19514a9199d43bdbbbc4ffc | [
"MIT"
] | null | null | null | customer_selection_line.py | pgmoka/checkout-simulator | bce7e68ba47b9309f19514a9199d43bdbbbc4ffc | [
"MIT"
] | null | null | null | customer_selection_line.py | pgmoka/checkout-simulator | bce7e68ba47b9309f19514a9199d43bdbbbc4ffc | [
"MIT"
] | null | null | null | '''
-----------------------------------------------------------------------
Additional Documentation
Made by Zachary A Brader, Kieran Coito, Pedro Goncalves Mokarzel
while attending University of Washington Bothell
Made in 03/09/2020
Based on instruction in CSS 458,
taught by professor Johnny Li... | 32.897436 | 99 | 0.590543 |
import numpy as np
import random as r
import matplotlib.pyplot as plt
import variables as v
from cashier import cashier
from customer import customer
from equal_distribution_line import equal_distribution_line
class customer_selection_line(equal_distribution_line):
customer_list = 0
... | true | true |
f710a1a8fb11a894a1f5202c9c336a54b665cf25 | 475 | py | Python | commons_util/logger/logger_factory.py | zhangdanyangg/commons-util-py | 65514ac1f5002b6156a31c09aeb38538a4d88cba | [
"Apache-2.0"
] | 7 | 2015-04-17T02:12:32.000Z | 2018-08-08T01:29:24.000Z | commons_util/logger/logger_factory.py | zhangdanyangg/commons-util-py | 65514ac1f5002b6156a31c09aeb38538a4d88cba | [
"Apache-2.0"
] | 3 | 2015-05-10T12:18:59.000Z | 2016-05-27T06:56:40.000Z | commons_util/logger/logger_factory.py | zhangdanyangg/commons-util-py | 65514ac1f5002b6156a31c09aeb38538a4d88cba | [
"Apache-2.0"
] | 4 | 2017-08-26T11:44:20.000Z | 2021-06-13T11:50:11.000Z | __author__ = 'Danyang'
import logging
import sys
class LoggerFactory(object):
def getConsoleLogger(self, cls_name, level=logging.DEBUG):
lgr = logging.getLogger(cls_name)
lgr.setLevel(level)
if not lgr.handlers:
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(leve... | 33.928571 | 102 | 0.633684 | __author__ = 'Danyang'
import logging
import sys
class LoggerFactory(object):
def getConsoleLogger(self, cls_name, level=logging.DEBUG):
lgr = logging.getLogger(cls_name)
lgr.setLevel(level)
if not lgr.handlers:
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(leve... | true | true |
f710a1c9df18743b2b56aa63b97b0a1180919b20 | 381 | py | Python | src/etl/common/timehelpers.py | vatdaell/spotify-analysis | 030239ba16cfc4a80d4f870686450c1ababc62c2 | [
"MIT"
] | 1 | 2020-10-14T10:01:37.000Z | 2020-10-14T10:01:37.000Z | src/etl/common/timehelpers.py | vatdaell/spotify-analysis | 030239ba16cfc4a80d4f870686450c1ababc62c2 | [
"MIT"
] | null | null | null | src/etl/common/timehelpers.py | vatdaell/spotify-analysis | 030239ba16cfc4a80d4f870686450c1ababc62c2 | [
"MIT"
] | null | null | null | from datetime import datetime
import datetime
def yesterday(today=datetime.datetime.now()):
yesterday = today - datetime.timedelta(days=1)
yesterday_timestamp = int(yesterday.timestamp()) * 1000
return yesterday_timestamp
def extractDate(name, prefix, fileType):
prefixLen = len(prefix)
fileTypeL... | 25.4 | 59 | 0.745407 | from datetime import datetime
import datetime
def yesterday(today=datetime.datetime.now()):
yesterday = today - datetime.timedelta(days=1)
yesterday_timestamp = int(yesterday.timestamp()) * 1000
return yesterday_timestamp
def extractDate(name, prefix, fileType):
prefixLen = len(prefix)
fileTypeL... | true | true |
f710a1f1b101dea4375a6417f55a26a8ac830bb1 | 11,358 | py | Python | steampak/libsteam/resources/apps.py | idlesign/steampak | cb3f2c737e272b0360802d947e388df7e34f50f3 | [
"BSD-3-Clause"
] | 24 | 2015-08-15T18:41:58.000Z | 2021-06-13T13:52:50.000Z | steampak/libsteam/resources/apps.py | idlesign/steampak | cb3f2c737e272b0360802d947e388df7e34f50f3 | [
"BSD-3-Clause"
] | 3 | 2016-10-12T13:46:07.000Z | 2017-03-05T02:54:22.000Z | steampak/libsteam/resources/apps.py | idlesign/steampak | cb3f2c737e272b0360802d947e388df7e34f50f3 | [
"BSD-3-Clause"
] | 3 | 2016-10-12T12:09:43.000Z | 2017-03-04T15:49:53.000Z | from datetime import datetime
from ctyped.types import CRef
from .base import _ApiResourceBase
from .stats import CurrentApplicationAchievements
from .user import User
class Application(_ApiResourceBase):
"""Exposes methods to get application data.
Aliased as ``steampak.SteamApplication``.
.. code-bloc... | 24.799127 | 111 | 0.606797 | from datetime import datetime
from ctyped.types import CRef
from .base import _ApiResourceBase
from .stats import CurrentApplicationAchievements
from .user import User
class Application(_ApiResourceBase):
def __init__(self, app_id, *args, **kwargs):
client = self.get_client()
self._iface = clie... | true | true |
f710a363b900ea04622cbff2e29a0c3ee6a7036c | 44,133 | py | Python | jupytext/cli.py | sdrees/jupytext | 3b1eaa21d3d139444bdc278a0b696c363838e085 | [
"MIT"
] | 11 | 2018-06-15T12:12:11.000Z | 2018-08-25T14:01:52.000Z | jupytext/cli.py | sdrees/jupytext | 3b1eaa21d3d139444bdc278a0b696c363838e085 | [
"MIT"
] | 33 | 2018-06-17T01:16:10.000Z | 2018-08-30T16:09:02.000Z | jupytext/cli.py | sdrees/jupytext | 3b1eaa21d3d139444bdc278a0b696c363838e085 | [
"MIT"
] | 1 | 2018-07-20T06:52:12.000Z | 2018-07-20T06:52:12.000Z | """`jupytext` as a command line tool"""
import argparse
import glob
import json
import os
import re
import shlex
import subprocess
import sys
import warnings
from copy import copy
from tempfile import NamedTemporaryFile
from .combine import combine_inputs_with_outputs
from .compare import NotebookDifference, compare,... | 35.448193 | 114 | 0.580246 |
import argparse
import glob
import json
import os
import re
import shlex
import subprocess
import sys
import warnings
from copy import copy
from tempfile import NamedTemporaryFile
from .combine import combine_inputs_with_outputs
from .compare import NotebookDifference, compare, test_round_trip_conversion
from .config... | true | true |
f710a3e5b600a82151ff00b430ce32b511a15cd8 | 3,363 | py | Python | spencer/settings.py | AJMansfield/Spencer-Bot | 6955e2dec78ebde4c01ed9f637040c4226ec14d0 | [
"Apache-2.0"
] | null | null | null | spencer/settings.py | AJMansfield/Spencer-Bot | 6955e2dec78ebde4c01ed9f637040c4226ec14d0 | [
"Apache-2.0"
] | null | null | null | spencer/settings.py | AJMansfield/Spencer-Bot | 6955e2dec78ebde4c01ed9f637040c4226ec14d0 | [
"Apache-2.0"
] | null | null | null | """
Django settings for spencer project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... | 25.671756 | 91 | 0.691347 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-#-js))k7nx&)biw-=pso3u*o%&w@_wngqw0kq1l3ckhh5(52s@'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
f710a3ecafc960d8f7fd50c71912c87d2588db52 | 411 | py | Python | exercises/structures/test/test_treasure_map.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | exercises/structures/test/test_treasure_map.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | exercises/structures/test/test_treasure_map.py | bmazey/summer2020 | 0e943c356677f1d0ec55da5fe4b30a54b37507cd | [
"MIT"
] | null | null | null | from exercises.structures.src.treasure_map import TreasureMap
tm = TreasureMap()
tm.populate_map()
def test_beach_key():
assert tm.map['beach'] == 'sandy shore'.casefold()
def test_coast_key():
assert tm.map['coast'] == 'ocean reef'.casefold()
def test_volcano_key():
assert tm.map['volcano'] == 'hot ... | 19.571429 | 61 | 0.681265 | from exercises.structures.src.treasure_map import TreasureMap
tm = TreasureMap()
tm.populate_map()
def test_beach_key():
assert tm.map['beach'] == 'sandy shore'.casefold()
def test_coast_key():
assert tm.map['coast'] == 'ocean reef'.casefold()
def test_volcano_key():
assert tm.map['volcano'] == 'hot ... | true | true |
f710a51bd1266dc4b0e1f75441f19122c01ede92 | 16,497 | py | Python | .vscode-server/data/User/History/-1f47d17c/Kqqg.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | null | null | null | .vscode-server/data/User/History/-1f47d17c/Kqqg.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | 1 | 2022-02-16T12:12:43.000Z | 2022-02-16T12:15:03.000Z | .vscode-server/data/User/History/-1f47d17c/Kqqg.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | null | null | null | # from flask import Flask, Blueprint
# from flask_sqlalchemy import SQLAlchemy
# from flask_login import LoginManager
# import os
from flask import Flask, jsonify, request, make_response, redirect, url_for
import jwt
import datetime
import os
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
import u... | 33.874743 | 235 | 0.655695 |
from flask import Flask, jsonify, request, make_response, redirect, url_for
import jwt
import datetime
import os
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
import uuid
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug.utils import secure_filename
from ... | true | true |
f710a56d3627ff3cc484543b10918a7e02d8f710 | 348 | py | Python | IPython/config/profile/python3/ipython_config.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2015-01-09T21:10:58.000Z | 2015-01-09T21:10:58.000Z | IPython/config/profile/python3/ipython_config.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 3 | 2015-04-01T13:14:57.000Z | 2015-05-26T16:01:37.000Z | IPython/config/profile/python3/ipython_config.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2015-05-17T14:14:26.000Z | 2015-05-17T14:14:26.000Z | c = get_config()
# If the master config file uses syntax that's invalid in Python 3, we'll skip
# it and just use the factory defaults.
try:
load_subconfig('ipython_config.py', profile='default')
except Exception:
pass
else:
# We reset exec_lines in case they're not compatible with Python 3.
c.Interact... | 29 | 78 | 0.729885 | c = get_config()
try:
load_subconfig('ipython_config.py', profile='default')
except Exception:
pass
else:
c.InteractiveShellApp.exec_lines = []
| true | true |
f710a66be19e70b5868e552408578511804999cb | 5,061 | py | Python | fastestimator/trace/metric/mcc.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | fastestimator/trace/metric/mcc.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | fastestimator/trace/metric/mcc.py | DwijayDS/fastestimator | 9b288cb2bd870f971ec4cee09d0b3205e1316a94 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The FastEstimator 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 appl... | 45.1875 | 120 | 0.657182 |
from typing import Union, Iterable
import numpy as np
from sklearn.metrics import matthews_corrcoef
from fastestimator.trace.meta._per_ds import per_ds
from fastestimator.trace.trace import Trace
from fastestimator.util.data import Any, Data, Dict
from fastestimator.util.traceability_util import traceab... | true | true |
f710a6a1dbb11d687aae20d29ee76bd20dcd3030 | 89 | py | Python | blackdog/admin.py | UncleGoogle/dafipost | 5e19d6a69dde9b7e5267bbdba680906bdb5e56eb | [
"MIT"
] | null | null | null | blackdog/admin.py | UncleGoogle/dafipost | 5e19d6a69dde9b7e5267bbdba680906bdb5e56eb | [
"MIT"
] | 1 | 2021-02-08T01:44:32.000Z | 2021-02-08T01:44:32.000Z | blackdog/admin.py | UncleGoogle/dafipost | 5e19d6a69dde9b7e5267bbdba680906bdb5e56eb | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Bark)
| 14.833333 | 32 | 0.797753 | from django.contrib import admin
from . import models
admin.site.register(models.Bark)
| true | true |
f710a6c24308bd6ba7693092f6d121cecdb9b7b8 | 1,607 | py | Python | inaccel/keras/applications/imagenet_utils.py | inaccel/keras | bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a | [
"Apache-2.0"
] | 1 | 2021-01-27T12:20:35.000Z | 2021-01-27T12:20:35.000Z | inaccel/keras/applications/imagenet_utils.py | inaccel/keras | bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a | [
"Apache-2.0"
] | null | null | null | inaccel/keras/applications/imagenet_utils.py | inaccel/keras | bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a | [
"Apache-2.0"
] | null | null | null | """Utilities for ImageNet data preprocessing & prediction decoding.
"""
import json
import keras.utils.data_utils as data_utils
CLASS_INDEX = None
CLASS_INDEX_PATH = ('https://storage.googleapis.com/download.tensorflow.org/'
'data/imagenet_class_index.json')
def decode_predictions(preds, top=5):
... | 33.479167 | 77 | 0.613566 |
import json
import keras.utils.data_utils as data_utils
CLASS_INDEX = None
CLASS_INDEX_PATH = ('https://storage.googleapis.com/download.tensorflow.org/'
'data/imagenet_class_index.json')
def decode_predictions(preds, top=5):
global CLASS_INDEX
if len(preds.shape) != 2 or preds.shape[1] !... | true | true |
f710a7f55ec93a0f5804d75f8bd5493b3a4d1321 | 3,798 | py | Python | tests/accounts/ecdsa_test.py | mustafa-travisci/lto-api.python | 0493a46b69575e94d09a038dadf472b46f88d036 | [
"MIT"
] | null | null | null | tests/accounts/ecdsa_test.py | mustafa-travisci/lto-api.python | 0493a46b69575e94d09a038dadf472b46f88d036 | [
"MIT"
] | null | null | null | tests/accounts/ecdsa_test.py | mustafa-travisci/lto-api.python | 0493a46b69575e94d09a038dadf472b46f88d036 | [
"MIT"
] | null | null | null | import copy
from lto.accounts.ecdsa.account_factory_ecdsa import AccountFactoryECDSA
import base58
import pytest
from lto.transactions.anchor import Anchor
class TestAccountECDSA():
factory = AccountFactoryECDSA('L')
seed = 'divert manage prefer child kind maximum october hand manual connect fitness small sym... | 50.64 | 199 | 0.718273 | import copy
from lto.accounts.ecdsa.account_factory_ecdsa import AccountFactoryECDSA
import base58
import pytest
from lto.transactions.anchor import Anchor
class TestAccountECDSA():
factory = AccountFactoryECDSA('L')
seed = 'divert manage prefer child kind maximum october hand manual connect fitness small sym... | true | true |
f710a859d9f52e08d86ed3ddb3b5b3af0b18ffd1 | 1,351 | py | Python | consolemenu/items/command_item.py | Gimli76/console-menu | febd66a49c199fb349a54499ff267c15e0e04bd9 | [
"MIT"
] | 1 | 2021-02-17T21:18:32.000Z | 2021-02-17T21:18:32.000Z | consolemenu/items/command_item.py | Gimli76/console-menu | febd66a49c199fb349a54499ff267c15e0e04bd9 | [
"MIT"
] | 10 | 2020-06-05T23:30:34.000Z | 2021-09-22T18:56:54.000Z | consolemenu/items/command_item.py | Gimli76/console-menu | febd66a49c199fb349a54499ff267c15e0e04bd9 | [
"MIT"
] | null | null | null | import subprocess
from consolemenu.items import ExternalItem
class CommandItem(ExternalItem):
"""
A menu item to execute a console command
"""
def __init__(self, text, command, arguments=None, menu=None, should_exit=False):
"""
:ivar str command: The console command to be executed
... | 30.704545 | 99 | 0.623242 | import subprocess
from consolemenu.items import ExternalItem
class CommandItem(ExternalItem):
def __init__(self, text, command, arguments=None, menu=None, should_exit=False):
super(CommandItem, self).__init__(text=text, menu=menu, should_exit=should_exit)
self.command = command
if argum... | true | true |
f710a98119943a2f7fadb0a04b71a3e85f1d84f5 | 722 | py | Python | tests/binpacking/solver/test_statistics.py | Jxtopher/binpacking | 6ce2a1cd071a0660c32f17f05298dde42942a2d9 | [
"MIT"
] | 1 | 2021-12-27T12:37:58.000Z | 2021-12-27T12:37:58.000Z | tests/binpacking/solver/test_statistics.py | Jxtopher/binpacking | 6ce2a1cd071a0660c32f17f05298dde42942a2d9 | [
"MIT"
] | null | null | null | tests/binpacking/solver/test_statistics.py | Jxtopher/binpacking | 6ce2a1cd071a0660c32f17f05298dde42942a2d9 | [
"MIT"
] | null | null | null | from tests.base import BaseTestCase
from binpacking.solver.data_structure.solution import Solution
from binpacking.solver.statistics import Statistics, StatisticIteration, StatisticFitness
class StatisticsTest(BaseTestCase):
def test_statistics(self) -> None:
iteration = StatisticIteration()
fitn... | 28.88 | 89 | 0.691136 | from tests.base import BaseTestCase
from binpacking.solver.data_structure.solution import Solution
from binpacking.solver.statistics import Statistics, StatisticIteration, StatisticFitness
class StatisticsTest(BaseTestCase):
def test_statistics(self) -> None:
iteration = StatisticIteration()
fitn... | true | true |
f710aa5ecac09bdab7ddb4892fe162790bf8b77d | 6,807 | py | Python | sdk/python/pulumi_aws/athena/database.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/athena/database.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/athena/database.py | Otanikotani/pulumi-aws | 00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 46.623288 | 288 | 0.665785 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['Database']
class Database(pulumi.CustomResource):
def __init__(__self__,
resource_name: s... | true | true |
f710aa676b7ed87b52497df6e971ab5a80b028fe | 1,281 | py | Python | typos.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | typos.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | typos.py | Ulzahk/Practica-Selenium-Python | f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf | [
"MIT"
] | null | null | null | import unittest
from selenium import webdriver
class Typos(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(executable_path = r'./chromedriver.exe')
driver = self.driver
driver.get('http://the-internet.herokuapp.com/')
driver.find_element_by_link_text('Typos').cl... | 29.113636 | 103 | 0.615925 | import unittest
from selenium import webdriver
class Typos(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(executable_path = r'./chromedriver.exe')
driver = self.driver
driver.get('http://the-internet.herokuapp.com/')
driver.find_element_by_link_text('Typos').cl... | true | true |
f710aa9ee8bb044fb5cf58191f744088af8709bd | 1,030 | py | Python | sherlock-and-the-valid-string.py | gauravkanoongo/cp | f33cec95c121876a737b0a90faa2a51238be52a3 | [
"MIT"
] | null | null | null | sherlock-and-the-valid-string.py | gauravkanoongo/cp | f33cec95c121876a737b0a90faa2a51238be52a3 | [
"MIT"
] | null | null | null | sherlock-and-the-valid-string.py | gauravkanoongo/cp | f33cec95c121876a737b0a90faa2a51238be52a3 | [
"MIT"
] | 1 | 2021-09-19T13:04:41.000Z | 2021-09-19T13:04:41.000Z | #!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'isValid' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING s as parameter.
#
def isValid(s):
# Write your code here
# Write your code here
freq = {i : s.count(i) for i in... | 20.6 | 66 | 0.526214 |
import math
import os
import random
import re
import sys
def isValid(s):
freq = {i : s.count(i) for i in set(s)}
fv = list(freq.values())
ffreq = {v : list(fv).count(v) for v in set(fv)}
print("s:",s, "\nfreq:", freq, "\nfv:", fv, "\nffreq:", ffreq)
if len(ffreq)>2:
retur... | true | true |
f710aac2afd303f05b5049f4348f7aafb94efd9a | 546 | py | Python | account/account_sample.py | appenz/minebot | e1bd18053873c4d686de57e014a2cd8f27d4dd4c | [
"Apache-2.0"
] | 11 | 2021-08-28T18:21:43.000Z | 2022-03-08T16:08:55.000Z | account/account_sample.py | appenz/minebot | e1bd18053873c4d686de57e014a2cd8f27d4dd4c | [
"Apache-2.0"
] | 3 | 2022-02-05T17:47:53.000Z | 2022-03-10T17:36:48.000Z | account/account_sample.py | appenz/minebot | e1bd18053873c4d686de57e014a2cd8f27d4dd4c | [
"Apache-2.0"
] | 5 | 2022-02-04T19:12:50.000Z | 2022-03-18T20:54:00.000Z | #
# Account information
#
# Copy this file to account.py and fill in the real values for the Minecraft account.
#
#
#
#
account = {
"user" : 'your@login.com',
"password" : 'your_password',
"master" : 'minecraft_name_who_the_bot_will_listen_to',
"host" : 'exampleserver.wha... | 21 | 85 | 0.569597 |
account = {
"user" : 'your@login.com',
"password" : 'your_password',
"master" : 'minecraft_name_who_the_bot_will_listen_to',
"host" : 'exampleserver.whatever.com',
"version" : '1.16.5',
}
locations = {
"minedrop": [29,13,-19],
"farmdr... | true | true |
f710aad9fae96e7df461ea9dc6b3959777fae07a | 3,074 | py | Python | apps/courts/views.py | gooseswan2/rent-a-court | 2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963 | [
"MIT"
] | null | null | null | apps/courts/views.py | gooseswan2/rent-a-court | 2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963 | [
"MIT"
] | null | null | null | apps/courts/views.py | gooseswan2/rent-a-court | 2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963 | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect
from django.contrib import messages
from django.template import Context
from .models import Court, CourtManager, SelectedCourt
from apps.users.models import User
from datetime import datetime
from decimal import Decimal
from django.contrib.auth.decorators import login_requir... | 30.74 | 118 | 0.617437 | from django.shortcuts import render,redirect
from django.contrib import messages
from django.template import Context
from .models import Court, CourtManager, SelectedCourt
from apps.users.models import User
from datetime import datetime
from decimal import Decimal
from django.contrib.auth.decorators import login_requir... | true | true |
f710ab8364bbdcbe4c3b37527988de78e77269bb | 5,653 | py | Python | test/test_mpc.py | AwhLorraine/mshoot | d6981fa37c55da0457ac0371f9850743858a3543 | [
"BSD-3-Clause"
] | 14 | 2019-01-15T14:30:43.000Z | 2022-02-06T08:36:36.000Z | test/test_mpc.py | AwhLorraine/mshoot | d6981fa37c55da0457ac0371f9850743858a3543 | [
"BSD-3-Clause"
] | 4 | 2019-02-01T10:32:48.000Z | 2021-02-21T08:53:53.000Z | test/test_mpc.py | AwhLorraine/mshoot | d6981fa37c55da0457ac0371f9850743858a3543 | [
"BSD-3-Clause"
] | 5 | 2019-02-08T09:20:52.000Z | 2021-04-25T02:17:54.000Z | import unittest
import os
import numpy as np
import pandas as pd
from scipy.signal import StateSpace
import matplotlib.pyplot as plt
import mshoot
def cfun(xdf, ydf):
"""
:param ydf: DataFrame, model states
:param ydf: DataFrame, model outputs
:return: float
"""
qout = ydf['qout'].values
... | 30.556757 | 110 | 0.523262 | import unittest
import os
import numpy as np
import pandas as pd
from scipy.signal import StateSpace
import matplotlib.pyplot as plt
import mshoot
def cfun(xdf, ydf):
qout = ydf['qout'].values
c = np.sum(qout ** 2) / qout.size
return c
class TestMPC(unittest.TestCase):
def setUp(self):
fm... | true | true |
f710abb49b22c3947a49393e8d333e11f696684b | 90,076 | py | Python | src/edges_cal/cal_coefficients.py | edges-collab/edges-cal | 9b7b28f71e1aa5347f901af38ef3bc0d28766e21 | [
"MIT"
] | null | null | null | src/edges_cal/cal_coefficients.py | edges-collab/edges-cal | 9b7b28f71e1aa5347f901af38ef3bc0d28766e21 | [
"MIT"
] | 86 | 2020-02-07T23:00:23.000Z | 2022-03-31T22:08:19.000Z | src/edges_cal/cal_coefficients.py | edges-collab/edges-cal | 9b7b28f71e1aa5347f901af38ef3bc0d28766e21 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The main user-facing module of ``edges-cal``.
This module contains wrappers around lower-level functions in other modules, providing
a one-stop interface for everything related to calibration.
"""
from __future__ import annotations
import attr
import h5py
import numpy as np
import tempfile... | 34.197418 | 88 | 0.566877 |
from __future__ import annotations
import attr
import h5py
import numpy as np
import tempfile
import warnings
import yaml
from abc import ABCMeta, abstractmethod
from astropy.convolution import Gaussian1DKernel, convolve
from copy import copy
from edges_io import io
from edges_io.logging import logger
from functools ... | true | true |
f710ac528885b1b93f31c632c55a3507e9b7fd6d | 3,475 | py | Python | pipe-cli/mount/pipefuse/fslock.py | cmbkoko1989/cloud-pipeline | 9af1218151ef02f87915726eb92c0cc626f7ab11 | [
"Apache-2.0"
] | null | null | null | pipe-cli/mount/pipefuse/fslock.py | cmbkoko1989/cloud-pipeline | 9af1218151ef02f87915726eb92c0cc626f7ab11 | [
"Apache-2.0"
] | null | null | null | pipe-cli/mount/pipefuse/fslock.py | cmbkoko1989/cloud-pipeline | 9af1218151ef02f87915726eb92c0cc626f7ab11 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.217391 | 111 | 0.624748 |
import logging
import time
from abc import ABCMeta, abstractmethod
from threading import RLock, Thread
from fuse import fuse_get_context
def get_lock(threads, monitoring_delay):
return PathLock(monitoring_delay=monitoring_delay) if threads else DummyLock()
def monitor_locks(monitor_lock, locks, t... | true | true |
f710ad5b4f762a06f4cdaff930cc88bfc18dba57 | 1,778 | py | Python | tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py | N5GEH/FiLiP | d24f47daa272a65ccf9c92522374bc5228b9a3d1 | [
"BSD-3-Clause"
] | null | null | null | tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py | N5GEH/FiLiP | d24f47daa272a65ccf9c92522374bc5228b9a3d1 | [
"BSD-3-Clause"
] | null | null | null | tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py | N5GEH/FiLiP | d24f47daa272a65ccf9c92522374bc5228b9a3d1 | [
"BSD-3-Clause"
] | null | null | null | """
# # Exercise 2: Service Health Check
# Create one or multiple filip clients and check if the corresponding services
# are up and running by accessing their version information.
# The input sections are marked with 'ToDo'
# #### Steps to complete:
# 1. Set up the missing parameters in the parameter section
# 2. C... | 32.327273 | 78 | 0.722722 |
\
HttpClient, \
HttpClientConfig, \
ContextBrokerClient, \
IoTAClient, \
QuantumLeapClient
ost:1026"
IOTA_URL = "http://localhost:4041"
QL_URL = "http://localhost:8668"
cbc = ContextBrokerClient(url=CB_URL)
print(cbc.get_version())
iotac = IoTAClient(url=IOTA_URL)
pr... | true | true |
f710adad5bc915650b1798112ca08af0d8455670 | 87 | py | Python | urban_dictionary/__init__.py | accessware/urban_dictionary | 8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80 | [
"MIT"
] | null | null | null | urban_dictionary/__init__.py | accessware/urban_dictionary | 8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80 | [
"MIT"
] | null | null | null | urban_dictionary/__init__.py | accessware/urban_dictionary | 8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80 | [
"MIT"
] | null | null | null | from .base import AsyncUrbanClient, UrbanClient, UrbanDefinition, UrbanDictionaryError
| 43.5 | 86 | 0.873563 | from .base import AsyncUrbanClient, UrbanClient, UrbanDefinition, UrbanDictionaryError
| true | true |
f710adfbd40b4b969e51b988eebe67de9aac564e | 976 | py | Python | cstock/model.py | dwarf-miner/midas | 68ff19da4a1f1a095b9c37e2fd53b77a2e27e562 | [
"MIT"
] | null | null | null | cstock/model.py | dwarf-miner/midas | 68ff19da4a1f1a095b9c37e2fd53b77a2e27e562 | [
"MIT"
] | null | null | null | cstock/model.py | dwarf-miner/midas | 68ff19da4a1f1a095b9c37e2fd53b77a2e27e562 | [
"MIT"
] | null | null | null | # Copyright (c) 2015 Walt Chen
#
# 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
class ParserException(Exception):
pass
... | 27.111111 | 80 | 0.623975 |
class ParserException(Exception):
pass
class Stock(object):
def __init__(self, code, date, open, high, low, close, volume):
self.code = code
self.date = str(date)
self.open = open
self.high = high
self.low = low
self.close = c... | true | true |
f710ae170b6af5321a2a68a244660e923a688a59 | 17,480 | py | Python | test_module.py | aivision2020/OctSceneScan | 3b22ecb4f701270f457a7c2d2702f758b8d584cf | [
"MIT"
] | 2 | 2019-01-18T04:10:00.000Z | 2019-12-03T13:03:03.000Z | test_module.py | aivision2020/OctSceneScan | 3b22ecb4f701270f457a7c2d2702f758b8d584cf | [
"MIT"
] | null | null | null | test_module.py | aivision2020/OctSceneScan | 3b22ecb4f701270f457a7c2d2702f758b8d584cf | [
"MIT"
] | 1 | 2019-12-03T13:03:04.000Z | 2019-12-03T13:03:04.000Z | from pathlib import Path
import copy
import time
import torch.optim as optim
import numpy as np
import torch
from torch.autograd import Variable
from model import *
from data_utils import *
import torch.nn as nn
from loguru import logger
feature_dim = 8
block_size = 16
pad=2
n_conv=3
thresh=0.5
debug = False
def test... | 36.877637 | 124 | 0.602918 | from pathlib import Path
import copy
import time
import torch.optim as optim
import numpy as np
import torch
from torch.autograd import Variable
from model import *
from data_utils import *
import torch.nn as nn
from loguru import logger
feature_dim = 8
block_size = 16
pad=2
n_conv=3
thresh=0.5
debug = False
def test... | true | true |
f710aff6c2d00b414cf21367b621f613665ccf10 | 14,123 | py | Python | sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typin... | 42.032738 | 117 | 0.631523 |
from typing import cast, List, TYPE_CHECKING
import time
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.exceptions import ServiceResponseTimeoutError
from ._timer import Timer
from .._utils import is_retryable_status_code
from .._search_indexing_buffered_sender_base import ... | true | true |
f710b041e326ba3e1326272da4562dee10691198 | 22,120 | py | Python | reports/migrations/0002_populate_weights.py | digideskio/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 2 | 2015-04-02T23:09:03.000Z | 2015-12-03T00:19:06.000Z | reports/migrations/0002_populate_weights.py | digideskio/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 13 | 2015-04-01T07:39:43.000Z | 2015-08-26T06:24:07.000Z | reports/migrations/0002_populate_weights.py | OpenUpSA/gmmp | d82a4be0787c3a3a9e27dc590d7974f9f884fbb6 | [
"Apache-2.0"
] | 2 | 2019-07-25T11:53:10.000Z | 2020-06-22T02:07:40.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
... | 20.692236 | 65 | 0.494711 |
from __future__ import unicode_literals
from django.db import migrations
from django_countries import countries
def populate_weights(apps, schema_editor):
Weights = apps.get_model("reports", "Weights")
db_alias = schema_editor.connection.alias
for item in COUNTRY_WEIGHTS:
country = item['Country... | true | true |
f710b17920f4b27ff5f612fbae4bb033721cb956 | 5,980 | py | Python | Flask-Web/flasky/app/auth/views.py | fengzse/Feng_Repository | a0c64cbdff09e536be23eeccf45bdf6cab62d78b | [
"Apache-2.0"
] | 1 | 2021-01-02T22:03:13.000Z | 2021-01-02T22:03:13.000Z | Flask-Web/flasky/app/auth/views.py | fengzse/Feng_Repository | a0c64cbdff09e536be23eeccf45bdf6cab62d78b | [
"Apache-2.0"
] | null | null | null | Flask-Web/flasky/app/auth/views.py | fengzse/Feng_Repository | a0c64cbdff09e536be23eeccf45bdf6cab62d78b | [
"Apache-2.0"
] | null | null | null | from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, logout_user, login_required, current_user
from . import auth
from .. import db
from ..models import User
from .forms import LoginForm, RegistrationForm, ChangePasswordForm, ResetPassword, ResetPasswordRequest, \
... | 37.142857 | 112 | 0.673746 | from flask import render_template, redirect, request, url_for, flash
from flask_login import login_user, logout_user, login_required, current_user
from . import auth
from .. import db
from ..models import User
from .forms import LoginForm, RegistrationForm, ChangePasswordForm, ResetPassword, ResetPasswordRequest, \
... | true | true |
f710b29b9753ff4ea7a019d0d600cff9936b42f5 | 6,366 | py | Python | examples/table.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | examples/table.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | examples/table.py | gungnir888/transitfeed3 | 406e7ca3fe274521ef5dbf9277c729182b5183cb | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2007 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 writ... | 35.966102 | 112 | 0.617499 |
import transitfeed
from optparse import OptionParser
import re
stops = {}
ule, table):
if len(table) >= 2:
r = schedule.add_route(short_name=table[0][0], long_name=table[0][1], route_type='Bus')
for trip in table[2:]:
if len(trip) > len(table[1]):
... | true | true |
f710b3d9f778c9716dcab7db75b7a4bc66a1cc43 | 1,565 | py | Python | fairseq/data/fairseq_dataset.py | nadongguri/fairseq | b651b000033fd8ff51d1c3bea76f4fd1897bdf9c | [
"MIT"
] | 50 | 2021-11-15T02:34:43.000Z | 2021-11-18T07:24:46.000Z | codes_src/fairseq/data/fairseq_dataset.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | null | null | null | codes_src/fairseq/data/fairseq_dataset.py | yujun531/WeTS | bba33ad64e10efd7d3d95b5a0b6ad125216542cf | [
"Unlicense"
] | 26 | 2021-11-15T02:35:14.000Z | 2021-11-15T08:25:42.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch.utils.data
class FairseqDataset(torch.utils.data.Dataset):
"""A dataset that provides helpers for batchi... | 29.528302 | 80 | 0.654313 |
import numpy as np
import torch.utils.data
class FairseqDataset(torch.utils.data.Dataset):
def __getitem__(self, index):
raise NotImplementedError
def __len__(self):
raise NotImplementedError
def collater(self, samples):
raise NotImplementedError
def num_tokens(self, i... | true | true |
f710b53acc9fd1364a5a8782c79a63384e6720e2 | 2,158 | py | Python | aptronics/bundling.py | agritheory/aptronics | 0a40ae3bf787fc3a1525ae3556ea6dca0ca31408 | [
"MIT"
] | null | null | null | aptronics/bundling.py | agritheory/aptronics | 0a40ae3bf787fc3a1525ae3556ea6dca0ca31408 | [
"MIT"
] | 34 | 2019-09-28T15:04:32.000Z | 2020-02-26T11:11:20.000Z | aptronics/bundling.py | agritheory/aptronics | 0a40ae3bf787fc3a1525ae3556ea6dca0ca31408 | [
"MIT"
] | 2 | 2016-02-17T16:39:55.000Z | 2019-10-15T21:11:51.000Z | import frappe
from frappe.utils import flt
def merge_bundled_items(self, method):
bundles = {}
item_meta = frappe.get_meta(self.doctype + " Item")
count = 0
copy_fields = ['qty', 'stock_qty']
sum_fields = ['total_weight', 'amount', 'net_amount']
rate_fields = [('rate', 'amount'), ('net_rate', 'net_amount'), ('w... | 30.394366 | 100 | 0.694161 | import frappe
from frappe.utils import flt
def merge_bundled_items(self, method):
bundles = {}
item_meta = frappe.get_meta(self.doctype + " Item")
count = 0
copy_fields = ['qty', 'stock_qty']
sum_fields = ['total_weight', 'amount', 'net_amount']
rate_fields = [('rate', 'amount'), ('net_rate', 'net_amount'), ('w... | true | true |
f710b5892d3ceb61675ec956d63092918bac41e6 | 4,736 | py | Python | src/sentry/interfaces/contexts.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | src/sentry/interfaces/contexts.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/interfaces/contexts.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
import string
from django.utils.encoding import force_text
from sentry.interfaces.base import Interface
from sentry.utils.json import prune_empty_keys
from sentry.utils.safe import get_path, trim
__all__ = ("Contexts",)
context_types = {}
class _IndexFormatter(st... | 26.606742 | 99 | 0.611275 | from __future__ import absolute_import
import six
import string
from django.utils.encoding import force_text
from sentry.interfaces.base import Interface
from sentry.utils.json import prune_empty_keys
from sentry.utils.safe import get_path, trim
__all__ = ("Contexts",)
context_types = {}
class _IndexFormatter(st... | true | true |
f710b5ffbebe49e837f19c94522a3272a6027073 | 1,784 | py | Python | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/79.word-search.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=79 lang=python3
#
# [79] Word Search
#
# @lc code=start
class Solution:
def exist(self, board, word):
start = [None, None]
h = len(board)
l = len(board[0])
walked = [[0] * l for _ in range(h)]
for i in range(h):
for j in range(l):
... | 30.758621 | 90 | 0.421525 |
class Solution:
def exist(self, board, word):
start = [None, None]
h = len(board)
l = len(board[0])
walked = [[0] * l for _ in range(h)]
for i in range(h):
for j in range(l):
if board[i][j] == word[0]:
start = [i, j]
... | true | true |
f710b63ba31a89c01f4bf06cfb94875dfffd398e | 6,376 | py | Python | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | 1 | 2021-07-08T15:29:53.000Z | 2021-07-08T15:29:53.000Z | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | null | null | null | fragment.py | soumitrasamanta/FragGenie | 9ce493d88e3479a286ce88dc0c5b199ea7c7e441 | [
"MIT"
] | null | null | null | """
-----------------------------------------------------------------------------
AUTHOR: Soumitra Samanta (soumitramath39@gmail.com)
-----------------------------------------------------------------------------
"""
import subprocess
import os
import numpy as np
from datetime import datetime
import pandas as pd
from ... | 33.382199 | 124 | 0.528545 |
import subprocess
import os
import numpy as np
from datetime import datetime
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Descriptors
__all__ = [
'FragGenie'
]
class FragGenie():
def __init__(self, dir_fraggenie=''):
self.dir_fraggenie = dir_fraggenie
... | true | true |
f710b66b0ac6b8256d7003a72fab84b564edbb14 | 6,541 | py | Python | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | 1 | 2019-05-10T10:26:42.000Z | 2019-05-10T10:26:42.000Z | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/expand_composite_test.py | jlmayfield/Cirq | dc1294f54118a9a4f92546ca13780b91615dd675 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.792553 | 77 | 0.591041 |
import cirq
def assert_equal_mod_empty(expected, actual):
drop_empty = cirq.DropEmptyMoments()
drop_empty.optimize_circuit(actual)
if expected != actual:
print('EXPECTED')
print(expected)
print('ACTUAL')
print(actual)
assert expected == actual
d... | true | true |
f710b6dee76ed44e8b32fb3065ab9d427703ea7d | 329 | py | Python | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | fs_warehouser/fs_warehouser.py | JesseAldridge/fs_warehouser | ad8c6794313729cff07b964b91fa0335154fee3c | [
"MIT"
] | null | null | null | import os, glob
def get_last_timestamped_dir_path(data_dir_path):
glob_path = os.path.join(os.path.expanduser(data_dir_path), '2*')
date_paths = glob.glob(glob_path)
date_paths.sort()
return date_paths[-1] if date_paths else None
if __name__ == '__main__':
print(get_last_timestamped_dir_path('~/fake_scraper... | 29.909091 | 67 | 0.768997 | import os, glob
def get_last_timestamped_dir_path(data_dir_path):
glob_path = os.path.join(os.path.expanduser(data_dir_path), '2*')
date_paths = glob.glob(glob_path)
date_paths.sort()
return date_paths[-1] if date_paths else None
if __name__ == '__main__':
print(get_last_timestamped_dir_path('~/fake_scraper... | true | true |
f710b77221f9ccb42a7760e5cf57e07915eb7a7e | 42,626 | py | Python | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 1 | 2022-03-05T14:50:58.000Z | 2022-03-05T14:50:58.000Z | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | null | null | null | test/functional/test_framework/messages.py | paymastercoinproject/paymastercoin | 8b1807fbff947bf67378376aa3c522db637157ba | [
"MIT"
] | 2 | 2021-12-25T12:39:07.000Z | 2022-02-14T03:03:36.000Z | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2019 The Bitcoin Core Developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... | 28.417333 | 262 | 0.599446 |
from codecs import encode
import copy
import hashlib
from io import BytesIO
import random
import socket
import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, assert_equal
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70014
MY_SUBVERSION = b"/pyt... | true | true |
f710b7ec16f6c2d873e98254f0217de121369296 | 24,902 | py | Python | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/recommend/ncf/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.024712 | 120 | 0.656132 |
import logging
import math
import os
import time
import timeit
import pickle
import numpy as np
import pandas as pd
from mindspore.dataset import GeneratorDataset, Sampler
import src.constants as rconst
import src.movielens as movielens
import src.stat_utils as stat_utils
DATASET_TO_NUM_USERS_AND_ITEMS... | true | true |
f710b8147a553fabf38ebede8c94806bd534a143 | 2,307 | py | Python | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 3,714 | 2021-05-26T03:42:15.000Z | 2022-03-31T16:45:20.000Z | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 43 | 2021-05-26T05:26:42.000Z | 2022-03-23T11:50:56.000Z | labml_nn/normalization/group_norm/experiment.py | BioGeek/annotated_deep_learning_paper_implementations | e2516cc3063cdfdf11cda05f22a10082297aa33e | [
"MIT"
] | 349 | 2021-05-26T21:07:09.000Z | 2022-03-31T07:52:00.000Z | """
---
title: CIFAR10 Experiment to try Group Normalization
summary: >
This trains is a simple convolutional neural network that uses group normalization
to classify CIFAR10 images.
---
# CIFAR10 Experiment for Group Normalization
"""
import torch.nn as nn
from labml import experiment
from labml.configs import ... | 26.517241 | 95 | 0.618986 |
import torch.nn as nn
from labml import experiment
from labml.configs import option
from labml_helpers.module import Module
from labml_nn.experiments.cifar10 import CIFAR10Configs
from labml_nn.normalization.group_norm import GroupNorm
class Model(Module):
def __init__(self, groups: int = 32):
super().... | true | true |
f710b83bd8594a1934a5829a1392dae4395ef186 | 305 | py | Python | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2017/07/obamacare-popularity-20170707/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1QOOhihZdUwdAJcUgkeokbx7YaDSkSGWtlXHvKXhHW3E'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.819672 |
import base_filters
COPY_GOOGLE_DOC_KEY = '1QOOhihZdUwdAJcUgkeokbx7YaDSkSGWtlXHvKXhHW3E'
USE_ASSETS = False
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| true | true |
f710b90a4060a39f957fd2a19f35fac1f130b7b9 | 2,324 | py | Python | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/objects/dns/sp_policy_info.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | from nca47.db import api as db_api
from nca47.db.sqlalchemy.models import Proximity as ProximityModel
from nca47.objects import base
from nca47.objects import fields as object_fields
class ProximityInfo(base.Nca47Object):
VERSION = '1.0'
fields = {
'tenant_id': object_fields.StringField(),
's... | 35.212121 | 76 | 0.674269 | from nca47.db import api as db_api
from nca47.db.sqlalchemy.models import Proximity as ProximityModel
from nca47.objects import base
from nca47.objects import fields as object_fields
class ProximityInfo(base.Nca47Object):
VERSION = '1.0'
fields = {
'tenant_id': object_fields.StringField(),
's... | true | true |
f710b99e0cb3fb44f98ec0ea8aa3312cc37d3fa8 | 719 | py | Python | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | 2 | 2016-03-09T08:05:42.000Z | 2020-05-30T02:33:51.000Z | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | null | null | null | drkcode/python/kktmat.py | kdeweese/DualRandomizedKaczmarz | 3d339e893fe1dcb91677f3240047801ca3c43162 | [
"BSD-3-Clause"
] | 2 | 2016-03-09T08:07:03.000Z | 2020-10-01T16:37:28.000Z | #!/usr/bin/env python
# kktmat.py -- KKT matrix from Laplacian matrix
#
# Copyright (C) <2016> <Kevin Deweese>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import scipy
def kktmat(L):
mat=scipy.sparse.coo_matrix(s... | 26.62963 | 63 | 0.659249 |
import scipy
def kktmat(L):
mat=scipy.sparse.coo_matrix(scipy.sparse.tril(L,-1))
row=mat.row
m=len(row)
n=L.shape[0]
col=mat.col
val=mat.data
R=scipy.array(-1/val)
i=scipy.concatenate([scipy.arange(0,m),scipy.arange(0,m)])
j=scipy.concatenate([row,col])
data=s... | true | true |
f710bb121dc39fe025e869b3c95d8b40ae0689d1 | 21,508 | py | Python | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | readthedocs/settings/base.py | santos22/readthedocs.org | 9802ad0d8677b9c4f2eea317a9574812e4e8ff8a | [
"MIT"
] | null | null | null | # pylint: disable=missing-docstring
import getpass
import os
from celery.schedules import crontab
from readthedocs.core.settings import Settings
from readthedocs.projects.constants import CELERY_LOW, CELERY_MEDIUM, CELERY_HIGH
try:
import readthedocsext # noqa
ext = True
except ImportError:
ext = Fals... | 33.038402 | 106 | 0.589455 |
import getpass
import os
from celery.schedules import crontab
from readthedocs.core.settings import Settings
from readthedocs.projects.constants import CELERY_LOW, CELERY_MEDIUM, CELERY_HIGH
try:
import readthedocsext
ext = True
except ImportError:
ext = False
_ = gettext = lambda s: s
class Com... | true | true |
f710bc0c7a452a8d63c48e69d4a6a414fc921a2e | 2,793 | py | Python | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 18 | 2015-12-15T17:56:18.000Z | 2021-04-10T13:49:48.000Z | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 303 | 2015-11-18T07:37:06.000Z | 2021-05-26T12:34:01.000Z | pdc/apps/contact/filters.py | hluk/product-definition-center | af79f73c30fa5f5709ba03d584b7a49b83166b81 | [
"MIT"
] | 27 | 2015-11-19T20:33:54.000Z | 2021-03-25T08:15:28.000Z | #
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import django_filters
from django.db.models import Q
from django_filters import FilterSet
from pdc.apps.common.filters import MultiValueFilter, MultiValueRegexFilter, value_is_not_empty
from . import models
fr... | 32.103448 | 95 | 0.712496 |
import django_filters
from django.db.models import Q
from django_filters import FilterSet
from pdc.apps.common.filters import MultiValueFilter, MultiValueRegexFilter, value_is_not_empty
from . import models
from .models import (Person,
Maillist,
GlobalComponentContact,
... | true | true |
f710bc6f51d67c9c28e1e8d61df7113edf1ef689 | 191 | py | Python | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc156/abc156_a/10265687.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
n, r = map(int, sys.stdin.readline().split())
def main():
res = r + 100 * max(10 - n, 0)
return res
if __name__ == '__main__':
ans = main()
print(ans)
| 15.916667 | 46 | 0.528796 | import sys
n, r = map(int, sys.stdin.readline().split())
def main():
res = r + 100 * max(10 - n, 0)
return res
if __name__ == '__main__':
ans = main()
print(ans)
| true | true |
f710bcbd79d2d6ab9a9da2e8a815f6df2e583197 | 21,262 | py | Python | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/healthcareapis/v20200330/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.588022 | 208 | 0.667764 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'PrivateEndpointConnectionResponse',
'PrivateEndpointResponse',
'PrivateLinkServiceConnectionStateResponse',
'ServiceA... | true | true |
f710bcdd6aae55098faa5368f8cdcae5b8cac447 | 408 | py | Python | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | null | null | null | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | 9 | 2020-06-05T20:29:39.000Z | 2022-03-12T00:10:48.000Z | educa/courses/api/urls.py | kformanowicz/educa | 290883dc973345c6d3784c6bb0cb784cec80fa60 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register('courses', views.CourseViewSet)
urlpatterns = [
url(r'^subjects/$', views.SubjectListView.as_view(), name='subject_list'),
url(r'^subjects/(?P<pk>\d+)/$', views.Su... | 31.384615 | 94 | 0.723039 | from django.conf.urls import include, url
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register('courses', views.CourseViewSet)
urlpatterns = [
url(r'^subjects/$', views.SubjectListView.as_view(), name='subject_list'),
url(r'^subjects/(?P<pk>\d+)/$', views.Su... | true | true |
f710be72959fb0be0368f06abdc06ed4a9466c4c | 1,401 | py | Python | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | zygoat/components/backend/docker_compose.py | Ian-MacLeod/zygoat | 83773fdebf8cddf06903c2d32bd575e33e23e252 | [
"MIT"
] | null | null | null | import importlib
import logging
from zygoat.constants import Phases, Projects
from zygoat.components import Component
from zygoat.config import yaml
from . import resources
log = logging.getLogger()
file_name = 'docker-compose.yml'
class DockerCompose(Component):
def _dump_config(self, data):
with open(... | 26.942308 | 97 | 0.681656 | import importlib
import logging
from zygoat.constants import Phases, Projects
from zygoat.components import Component
from zygoat.config import yaml
from . import resources
log = logging.getLogger()
file_name = 'docker-compose.yml'
class DockerCompose(Component):
def _dump_config(self, data):
with open(... | true | true |
f710be848a7796c69f453a60a5b769bb077868cc | 11,427 | py | Python | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | 2 | 2021-09-13T09:40:12.000Z | 2021-09-13T11:37:54.000Z | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | null | null | null | main.py | ikuroNoriiwa/shellcode_transform | fac7d04168d9f3888a63c7ce76cc93bc8bef0058 | [
"Apache-2.0"
] | 1 | 2021-07-09T17:06:46.000Z | 2021-07-09T17:06:46.000Z | #!/usr/bin/python3
import argparse
from os.path import isfile
from pathlib import Path
from re import compile, findall, split as re_split, sub, search, match
from utils import error
def parse_buffer(encode_detail_buffer, shellcode, numberbefore=0, numberafter=0):
"""
parse le buffer et renvoie un tuple comm... | 45.891566 | 240 | 0.543362 |
import argparse
from os.path import isfile
from pathlib import Path
from re import compile, findall, split as re_split, sub, search, match
from utils import error
def parse_buffer(encode_detail_buffer, shellcode, numberbefore=0, numberafter=0):
print(encode_detail_buffer)
print(shellcode)
print(numbera... | true | true |
f710bec06f616273ff86b3dba79e21d3bc0e6645 | 6,784 | py | Python | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 19 | 2019-07-01T08:25:29.000Z | 2022-01-26T14:46:51.000Z | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 5 | 2019-07-02T13:36:42.000Z | 2021-09-14T06:46:48.000Z | examples/basic_example_v1/basic_example_data.py | yandex-cloud/ydb-python-sdk | 0df2dce2d77fc41ad3020072740f51dd91630177 | [
"Apache-2.0"
] | 10 | 2019-06-07T10:36:19.000Z | 2021-10-15T08:58:11.000Z | # -*- coding: utf-8 -*-
import iso8601
def to_days(date):
timedelta = iso8601.parse_date(date) - iso8601.parse_date("1970-1-1")
return timedelta.days
class Series(object):
__slots__ = ('series_id', 'title', 'release_date', 'series_info')
def __init__(self, series_id, title, release_date, series_inf... | 46.786207 | 117 | 0.573261 |
import iso8601
def to_days(date):
timedelta = iso8601.parse_date(date) - iso8601.parse_date("1970-1-1")
return timedelta.days
class Series(object):
__slots__ = ('series_id', 'title', 'release_date', 'series_info')
def __init__(self, series_id, title, release_date, series_info):
self.series... | true | true |
f710c21983c49887ee85a144d3507038da6ab576 | 1,698 | py | Python | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | matrix/The_Vector_problems.py | tjctw/PythonNote | e93cebbc6bf9748966f761eff6a9ad7b12e9ece5 | [
"CC0-1.0"
] | null | null | null | # version code 80e56511a793+
# Please fill out this stencil and submit using the provided submission script.
# Some of the GF2 problems require use of the value GF2.one so the stencil imports it.
from GF2 import one
## 1: (Problem 2.14.1) Vector Addition Practice 1
#Please express each answer as a list of numbers
... | 22.051948 | 86 | 0.651943 |
from GF2 import one
.]
p1_v_minus_u = [...]
p1_three_v_minus_two_u = [...]
_u = [...]
p2_v_minus_u = [...]
p2_two_v_minus_u = [...]
p2_v_plus_two_u = [...]
]
## 4: (Problem 2.14.4) GF2 Vector Addition A
# Please express your solution as a subset of the letters {'a','b','c','d','e','f'}.
# For example, ... | true | true |
f710c21a88409fcff3b7068fee986b0767faa304 | 2,658 | py | Python | huggingface_ner/preprocess.py | dertilo/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | 1 | 2020-05-08T09:05:47.000Z | 2020-05-08T09:05:47.000Z | huggingface_ner/preprocess.py | TUB-NLP-OpenData/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | null | null | null | huggingface_ner/preprocess.py | TUB-NLP-OpenData/sequence-tagging | c7a264ee32fb4b9d2337c466d4c12552e7ddb799 | [
"MIT"
] | null | null | null | import argparse
import sys
from collections import Counter
from tqdm import tqdm
from transformers import AutoTokenizer
def read_and_preprocess(file:str):
subword_len_counter = 0
with open(file, "rt") as f_p:
for line in f_p:
line = line.rstrip()
if not line:
y... | 28.276596 | 100 | 0.598947 | import argparse
import sys
from collections import Counter
from tqdm import tqdm
from transformers import AutoTokenizer
def read_and_preprocess(file:str):
subword_len_counter = 0
with open(file, "rt") as f_p:
for line in f_p:
line = line.rstrip()
if not line:
y... | true | true |
f710c2c88539af8f36a8ca8272678561a8d6d0ba | 1,075 | py | Python | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | scripts/embeddings.py | serre-lab/brownUnconference | c51758f0bf695648832448c5c166e2a8dea14268 | [
"MIT"
] | null | null | null | import argparse
import csv
import torch
import transformers
def parse_arguments():
parser = argparse.ArgumentParser(description="MiniConf Portal Command Line")
parser.add_argument("papers", default=False, help="papers file to parse")
return parser.parse_args()
if __name__ == "__main__":
args = par... | 31.617647 | 83 | 0.661395 | import argparse
import csv
import torch
import transformers
def parse_arguments():
parser = argparse.ArgumentParser(description="MiniConf Portal Command Line")
parser.add_argument("papers", default=False, help="papers file to parse")
return parser.parse_args()
if __name__ == "__main__":
args = par... | true | true |
f710c311e6b5c5805939067fdc6c52f6401f15f1 | 1,319 | py | Python | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-06-02T11:50:06.000Z | 2018-06-02T11:50:06.000Z | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-01-17T04:16:29.000Z | 2018-01-30T09:01:44.000Z | python-module/setup.py | SSICLOPS/cppl | 265514bc461352b7b5bc58fd7482328601029e4a | [
"Apache-2.0"
] | 1 | 2018-11-18T20:31:54.000Z | 2018-11-18T20:31:54.000Z | from distutils.core import setup, Extension
import sys
major_version = '4'
minor_version = '0'
cpplmodule = Extension('cppl_cpp_python_bridge',
define_macros = [('MAJOR_VERSION', major_version),
('MINOR_VERSION', minor_version)],
include_dir... | 43.966667 | 131 | 0.551175 | from distutils.core import setup, Extension
import sys
major_version = '4'
minor_version = '0'
cpplmodule = Extension('cppl_cpp_python_bridge',
define_macros = [('MAJOR_VERSION', major_version),
('MINOR_VERSION', minor_version)],
include_dir... | true | true |
f710c366338ee89946b9f99f27d37a342ac49eca | 893 | py | Python | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | config.py | devseme/Blogs-App | 06e4aed7cfa7b4985e1d11e48c500305d69ef9cc | [
"MIT"
] | null | null | null | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = False
UPLOADED_PHOTOS_DEST = 'app/static/photos'
# email configurations
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get("MAIL_USER... | 20.767442 | 82 | 0.702128 | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = False
UPLOADED_PHOTOS_DEST = 'app/static/photos'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERNAME = os.environ.get("MAIL_USERNAME")
MAIL_PASSWOR... | true | true |
f710c3c42e825b9a3c844e48547f214cc48ab052 | 5,249 | py | Python | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | lambda/py/lambda_upload/ask_sdk_model/events/skillevents/skill_enabled_request.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 38.595588 | 182 | 0.637074 |
import pprint
import re
import six
import typing
from enum import Enum
from ask_sdk_model.request import Request
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional
from datetime import datetime
class SkillEnabledRequest(Request):
deserialized_types = {
'object_type... | true | true |
f710c4fea0ba46f981807f2668cecb5daab0e12a | 4,128 | py | Python | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 355 | 2020-12-12T03:29:28.000Z | 2022-03-31T22:47:29.000Z | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 34 | 2020-12-24T11:50:51.000Z | 2022-03-18T00:06:38.000Z | examples/algorithms/groupDRO.py | KeAWang/wilds | 3b808a84bd477d7877b77675eec2953128a87033 | [
"MIT"
] | 87 | 2020-12-16T08:13:21.000Z | 2022-03-24T17:00:17.000Z | import torch
from algorithms.single_model_algorithm import SingleModelAlgorithm
from models.initializer import initialize_model
class GroupDRO(SingleModelAlgorithm):
"""
Group distributionally robust optimization.
Original paper:
@inproceedings{sagawa2019distributionally,
title={Distribu... | 39.314286 | 142 | 0.610707 | import torch
from algorithms.single_model_algorithm import SingleModelAlgorithm
from models.initializer import initialize_model
class GroupDRO(SingleModelAlgorithm):
def __init__(self, config, d_out, grouper, loss, metric, n_train_steps, is_group_in_train):
assert config.uniform_over_groups
... | true | true |
f710c6110376f8c01aecd9ca8aebf4d7950f3199 | 8,006 | py | Python | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | DATA/Labeling.py | IewNixIl/graduation_project_under | 67d0345208511bb06c35c3453227b2fa4ebef4a3 | [
"MIT"
] | null | null | null | import numpy
from matplotlib import pyplot
import gdal
from skimage import io,exposure
from skimage.segmentation import slic,mark_boundaries
import os
from PIL import Image
import shelve
import sys
sys.path.append('..')
from Config import config
def seg(path,n_segments=500, compactness=20):
i=io.imread(path)[:,... | 28.695341 | 118 | 0.533475 | import numpy
from matplotlib import pyplot
import gdal
from skimage import io,exposure
from skimage.segmentation import slic,mark_boundaries
import os
from PIL import Image
import shelve
import sys
sys.path.append('..')
from Config import config
def seg(path,n_segments=500, compactness=20):
i=io.imread(path)[:,... | true | true |
f710c7c26ca691b1517407f9a1238bc3759d8852 | 312 | py | Python | tests/urls.py | zonnepanelendelen/django-fsm-log | 28e2469693425efbeaf604f40db836977fbb68ff | [
"MIT"
] | 140 | 2015-01-07T19:12:49.000Z | 2021-08-14T14:17:12.000Z | tests/urls.py | zonnepanelendelen/django-fsm-log | 28e2469693425efbeaf604f40db836977fbb68ff | [
"MIT"
] | 81 | 2015-02-27T13:07:29.000Z | 2022-01-14T11:26:58.000Z | tests/urls.py | kcrebound/django-fsm-log | b2acc23d2a3398f07deacaf0911a763fbc6f4a75 | [
"MIT"
] | 73 | 2015-01-07T17:07:21.000Z | 2021-12-10T07:34:54.000Z | try:
from django.urls import path
from django.contrib import admin
urlpatterns = [path('admin', admin.site.urls)]
except ImportError:
# django < 2.0
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
| 26 | 61 | 0.689103 | try:
from django.urls import path
from django.contrib import admin
urlpatterns = [path('admin', admin.site.urls)]
except ImportError:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
| true | true |
f710c807738df97a99495e8269c1fb300b203df9 | 2,026 | py | Python | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 9 | 2020-10-13T23:25:29.000Z | 2022-02-10T06:54:48.000Z | tensorflow/python/ipu/keras/layers/recomputation.py | chenzhengda/tensorflow | 8debb698097670458b5f21d728bc6f734a7b5a53 | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.000Z | # Copyright 2021 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... | 33.766667 | 80 | 0.71619 |
from tensorflow.python.keras.engine.base_layer import Layer
from tensorflow.python.ipu.ops import pipelining_ops
class RecomputationCheckpoint(Layer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def call(self, inputs, **kwargs):
return pipelining_ops.recomputation_checkpoint(i... | true | true |
f710c8dc0ae9c607360da95e07304279627fd52e | 3,944 | py | Python | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZYXEL-BRIDGE-CONTROL-PROTOCOL-TRANSPARENCY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:43:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 ... | 131.466667 | 665 | 0.811359 |
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuild... | true | true |
f710cd85c0f4915e384055a6b54566ba32288ac7 | 5,447 | py | Python | library/bitcash-master/docs/source/conf.py | Devel484/CryptoPay-Crypto | 76ae0486ea86b5fa121af42c6d0b9efa279b97ee | [
"MIT"
] | 2 | 2020-09-08T22:59:33.000Z | 2020-12-30T06:28:29.000Z | docs/source/conf.py | AlphaGriffin/bitcash | 793e632733b4ea8988b23c7804c00034f9fc0427 | [
"MIT"
] | null | null | null | docs/source/conf.py | AlphaGriffin/bitcash | 793e632733b4ea8988b23c7804c00034f9fc0427 | [
"MIT"
] | 1 | 2020-12-30T06:28:41.000Z | 2020-12-30T06:28:41.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Bitcash documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 20 15:41:44 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | 29.603261 | 79 | 0.679457 |
from bitcash import __version__
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinxcontrib.fulltoc'
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'Bitcash'
copyright = '2017, Ofek Lev'
author = 'Ofek Le... | true | true |
f710cde440c8546e165803127d3fe665e30c7217 | 136 | py | Python | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | geo_files/geo_networkx.py | floristevito/SEN9120_Advanced_Agent_Based_Modelling | fc45d02f3add05fb5db23c920d6702f1e704ef21 | [
"MIT"
] | null | null | null | import geopandas as gpd
# Networkx werkt erg traag
gdf = gpd.read_file(r"C:\Users\bruno\Downloads\snelwegen_provincie.geojson")
gdf
| 15.111111 | 76 | 0.779412 | import geopandas as gpd
gdf = gpd.read_file(r"C:\Users\bruno\Downloads\snelwegen_provincie.geojson")
gdf
| true | true |
f710ce94cd50e7263e3201853259575b309288ba | 260 | py | Python | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | null | null | null | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | 1 | 2021-11-16T14:36:23.000Z | 2021-11-16T14:36:23.000Z | examples/host/status_receiver.py | ci4rail/esp_test_status_report | a54ffc81adb6cd6ffa22f7dc913010154f7ffca0 | [
"Apache-2.0"
] | null | null | null | import socket
import sys
ESP_IP = '192.168.7.1'
PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('try to connect')
sock.connect((ESP_IP, PORT))
print('connected...')
data = sock.recv(255)
print('msg: ', data.decode())
sock.close()
| 18.571429 | 56 | 0.707692 | import socket
import sys
ESP_IP = '192.168.7.1'
PORT = 10000
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('try to connect')
sock.connect((ESP_IP, PORT))
print('connected...')
data = sock.recv(255)
print('msg: ', data.decode())
sock.close()
| true | true |
f710cf1996c86a9c50d9c2272c951efd092ad2b2 | 2,288 | py | Python | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 50 | 2015-10-18T02:54:52.000Z | 2021-12-05T07:54:08.000Z | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 13 | 2015-10-29T12:54:07.000Z | 2021-09-02T06:17:42.000Z | monasca_api/conf/types.py | MheniMerz/monasca-api | 9c0892a58622082ed8baf81ee2f621cc68f5b42c | [
"Apache-2.0"
] | 81 | 2015-10-21T07:43:30.000Z | 2022-01-07T03:35:05.000Z | # Copyright 2017 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 35.75 | 79 | 0.65035 |
from oslo_config import cfg
from oslo_config import types
from oslo_utils import netutils
class HostAddressPortOpt(cfg.Opt):
def __init__(self, name, **kwargs):
ip_port_type = HostAddressPortType()
super(HostAddressPortOpt, self).__init__(name,
... | true | true |
f710cf7c42a883633b27ede44b5fceb415cbf5e8 | 5,101 | py | Python | scripts/Tennis Ball Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 17 | 2020-03-27T10:33:16.000Z | 2021-06-07T10:29:13.000Z | scripts/Tennis_Ball_Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | null | null | null | scripts/Tennis_Ball_Detection/ball_detection_taskphase.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 7 | 2020-03-06T03:53:57.000Z | 2021-01-15T14:31:31.000Z | #!/usr/bin/env python3
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import numpy as np
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5, 5))
kernel1= cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3, 3))
aratio = 1.0
def nothing(x):
pass
# ********************... | 34.006667 | 125 | 0.53068 |
import rospy
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import numpy as np
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(5, 5))
kernel1= cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3, 3))
aratio = 1.0
def nothing(x):
pass
def adjust_gamma(image, gamma=1.0):
if ... | true | true |
f710cff3f98e1377242473c9bcc5e0534ef79cd9 | 2,449 | py | Python | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | 3 | 2018-08-30T16:17:09.000Z | 2020-01-13T05:13:08.000Z | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | null | null | null | glowing/data/glowing/functions/generate_adjust_tags.py | dv-extrarius/dv-datapacks | b03b7f0a02a62ff7d66a60c3c8b7517fac4bc09b | [
"MIT"
] | null | null | null | #line = r'''execute if score waveGlowTimer glowTimer matches %s run tag @e[type=!player,type=!dolphin,distance=%s,nbt={Attributes:[{Name:"generic.attackDamage"}]},nbt=!{Glowing: 1b}] add madeGlowing'''
#type=!player,type=!dolphin,distance=16..20,nbt={Attributes:[{Name:"generic.attackDamage"}]},nbt=!{Glowing: 1b}
line =... | 61.225 | 201 | 0.681503 |
line = r'''execute if score waveGlowTimer glowTimer matches %s if entity @a[distance=%s] run tag @s add madeGlowing'''
bandDistance = 4
bandDuration = 0
minDistance = 16
maxDistance = 64
timeMod = (3 * bandDistance)
distMod = maxDistance - minDistance
def dotdotspan(start, end):
if start != end:
return "%... | true | true |
f710d02252626211a863cd5b3d96abcfce335204 | 6,435 | py | Python | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | 1 | 2020-08-18T06:05:20.000Z | 2020-08-18T06:05:20.000Z | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | null | null | null | wip/pulumi/helpers.py | 4c74356b41/IaC | 3938519c33c72fc5c0552a5f4dfd894a5952c527 | [
"MIT"
] | null | null | null | import os
import re
import secrets
import string
import pulumi
from pulumi import ResourceOptions
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from azure.keyvault import KeyVaultClient, KeyVaultAuthentication, KeyVaultId
from azure.common.credentials import ServicePri... | 30.070093 | 424 | 0.56519 | import os
import re
import secrets
import string
import pulumi
from pulumi import ResourceOptions
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from azure.keyvault import KeyVaultClient, KeyVaultAuthentication, KeyVaultId
from azure.common.credentials import ServicePri... | true | true |
f710d0ba4867c668f8feb836bbb131e08fa75b00 | 938 | py | Python | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | sysflags/cli.py | JosiahKerley/flags | e39a46060efeab778d2e5f15550ad3801cce1a55 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
from .database import YamlDatabase as DB
from . import utils
def cli():
parser = argparse.ArgumentParser()
parser.add_argument('-S', '--scope', default='directory', help="flag scope")
parser.add_argument('-F', '--output-format', default='yaml', dest='format', help="outp... | 39.083333 | 99 | 0.697228 |
import argparse
from .database import YamlDatabase as DB
from . import utils
def cli():
parser = argparse.ArgumentParser()
parser.add_argument('-S', '--scope', default='directory', help="flag scope")
parser.add_argument('-F', '--output-format', default='yaml', dest='format', help="output format")
parser.... | true | true |
f710d21e432038416b298e6b3a84477228b6564c | 759 | py | Python | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | CajuM/spacy-lookups-data | 52d996165f2de57731dbd088493592b1d5dfaaf9 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from spacy.lang.da import Danish
import pytest
@pytest.fixture(scope="session")
def da_nlp():
return Danish()
@pytest.mark.parametrize(
"string,lemma",
[
("affaldsgruppernes", "affaldsgruppe"),
("detailhandelsstrukturernes", "detai... | 23 | 72 | 0.673254 |
from __future__ import unicode_literals
from spacy.lang.da import Danish
import pytest
@pytest.fixture(scope="session")
def da_nlp():
return Danish()
@pytest.mark.parametrize(
"string,lemma",
[
("affaldsgruppernes", "affaldsgruppe"),
("detailhandelsstrukturernes", "detailhandelsstruktu... | true | true |
f710d25f24ddec548a668960e642e38c0c271832 | 1,156 | py | Python | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-06-25T15:25:29.000Z | 2020-06-25T15:25:29.000Z | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/libcircle/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 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 Libcircle(AutotoolsPackage):
"""libcircle provides an efficient distributed queue on a clu... | 39.862069 | 186 | 0.701557 |
from spack import *
class Libcircle(AutotoolsPackage):
homepage = "https://github.com/hpc/libcircle"
git = "https://github.com/hpc/libcircle.git"
url = "https://github.com/hpc/libcircle/releases/download/0.2.1-rc.1/libcircle-0.2.1-rc.1.tar.gz"
version('master', branch='master')
ve... | true | true |
f710d28b750d8653844e380b43142853926905f5 | 6,960 | py | Python | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 180 | 2018-09-20T07:27:40.000Z | 2022-03-19T07:55:42.000Z | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 80 | 2018-09-26T18:55:56.000Z | 2022-02-10T02:03:26.000Z | macro_benchmark/Mask_RCNN_PyTorch/maskrcnn_benchmark/config/paths_catalog_dbcluster.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 72 | 2018-08-30T00:49:15.000Z | 2022-02-15T23:22:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Copyright (c) 2018-2019 NVIDIA CORPORATION. All rights reserved.
"""Centralized catalog of paths."""
import os
class DatasetCatalog(object):
DATA_DIR = os.environ['DATA_DIR']
DATASETS = {
"coco_2017_train": {
"img_d... | 39.545455 | 117 | 0.604167 |
import os
class DatasetCatalog(object):
DATA_DIR = os.environ['DATA_DIR']
DATASETS = {
"coco_2017_train": {
"img_dir": "train2017",
"ann_file": "annotations/instances_train2017.json"
},
"coco_2017_val": {
"img_dir": "val2017",
"ann_fil... | true | true |
f710d41f3956bdcf4108ffe790cab0b83a899be7 | 6,249 | py | Python | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | avod/core/avod_fc_layers/basic_fc_layers.py | AhmedYousriSobhi/avod | 04a8c1edd87811139cbb2318796f0eb226e7c039 | [
"MIT"
] | null | null | null | import tensorflow.compat.v1 as tf
#from tensorflow.contrib import slim
import tf_slim as slim
from avod.core.avod_fc_layers import avod_fc_layer_utils
def build(fc_layers_config,
input_rois, input_weights,
num_final_classes, box_rep,
is_training,
end_points_collection):
"... | 37.872727 | 91 | 0.517843 | import tensorflow.compat.v1 as tf
import tf_slim as slim
from avod.core.avod_fc_layers import avod_fc_layer_utils
def build(fc_layers_config,
input_rois, input_weights,
num_final_classes, box_rep,
is_training,
end_points_collection):
fusion_method = fc_layers_confi... | true | true |
f710d496dd5fcb018569353131c4258483deb47c | 5,937 | py | Python | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 574 | 2019-07-12T08:35:18.000Z | 2022-03-28T06:37:44.000Z | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 55 | 2019-07-11T11:31:16.000Z | 2022-03-11T23:54:54.000Z | joints_detectors/Alphapose/yolo/video_demo_half.py | rcourivaud/video-to-pose3D | b908014fe2c531c075c11cee72bb798120f970c2 | [
"MIT"
] | 123 | 2019-09-06T07:08:40.000Z | 2022-03-26T21:50:28.000Z | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from .util import *
from .darknet import Darknet
from .preprocess import prep_image, inp_to_image, letterbox_image
import pandas as pd
import random
import pickle as pkl
im... | 31.247368 | 130 | 0.544551 | from __future__ import division
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import cv2
from .util import *
from .darknet import Darknet
from .preprocess import prep_image, inp_to_image, letterbox_image
import pandas as pd
import random
import pickle as pkl
im... | true | true |
f710d4d4c51c7045bd1d12faab81c40a48ed0b78 | 5,382 | py | Python | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | httpclient.py | YeeSkywalker/CMPUT404-assignment-web-client | 0d1a3d8a3aaaeb30320ed156b085ce5e6f6aaf1e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2016 Abram Hindle, https://github.com/tywtyw2002, and https://github.com/treedust
#
# 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
#
# ... | 28.17801 | 93 | 0.551839 |
# Write your own HTTP GET and POST
# The point is to understand what you have to send and get experience with it
import sys
import socket
import re
# you may use urllib to encode data appropriately
from urllib.parse import urlparse
def help():
print("httpclient.py [GET/POST] [URL]\n")
class HTTP... | true | true |
f710d56e22dcbfc23572787429824b9582db461d | 43,545 | py | Python | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 26 | 2017-07-07T08:06:31.000Z | 2021-11-25T06:41:24.000Z | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 9 | 2016-12-28T03:08:29.000Z | 2019-01-30T16:00:28.000Z | laygo/generators/serdes/des_layout_generator_woM5.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 10 | 2018-07-14T01:31:28.000Z | 2021-08-21T10:18:30.000Z | #!/usr/bin/python
########################################################################################################################
#
# Copyright (c) 2014, Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permi... | 72.69616 | 195 | 0.578321 |
f, shape=np.array([1,1]),
template_libname=templib_logic))
idivbuf.append(laygen.relplace(name = "I" + objectname_pfix + 'DIVBUF1x', templatename = 'inv_1x',
gridname = pg, refinstname = idivbuf[-1].name, transform=tf, shape=... | true | true |
f710d5a412901836e4796796cab79d895bf657b5 | 8,929 | py | Python | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | healthbuddy_backend/fake_news/tests.py | Asfak06/health-buddy | 1a40a35a95bc4179a44445ed0c0b9dc32360e0bc | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.urls import reverse_lazy
from .models import FakeNews
from ..utils.base_test import AuthenticationTestTemplate
class FakeNewsListTestCase(AuthenticationTestTemplate):
def _get_callable_client_method_http(self):
return self._client.get
def _get_... | 36.594262 | 100 | 0.648897 | from django.contrib.auth.models import User
from django.urls import reverse_lazy
from .models import FakeNews
from ..utils.base_test import AuthenticationTestTemplate
class FakeNewsListTestCase(AuthenticationTestTemplate):
def _get_callable_client_method_http(self):
return self._client.get
def _get_... | true | true |
f710d5e5f3aa834fea1af550af11e0df2f6a9ed5 | 1,957 | py | Python | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | Ronnakornschool/Ronschool.py | plug8955/Ronnakornschool | 94ea8216c83a974a1e904cad612378d970f50e7b | [
"MIT"
] | null | null | null | # Ronschool.py
class Student:
def __init__(self,name): # self คือคำพิเศษเพื่อใช้แทนตัวมันเอง / ต้องใส่ทุกฟังชั่นของ class
self.name = name
# student1.name
# self = student1
self.exp = 0
self.lesson = 0
def Hello(self):
print('สวัสดีจ้าาาา ผมชื่อ{}'.format(self.name))
def Coding(self):
... | 23.865854 | 93 | 0.591211 |
class Student:
def __init__(self,name):
self.name = name
self.exp = 0
self.lesson = 0
def Hello(self):
print('สวัสดีจ้าาาา ผมชื่อ{}'.format(self.name))
def Coding(self):
print('{}: กำลังเขียนโปรแกรม..'.format(self.name))
self.exp += 5
self.lesson += 1
def ShowEXP(self):
... | true | true |
f710d60b379f14a690eba23786aa9f232b64b970 | 423 | py | Python | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | mspsmc/cli.py | terhorst/mspsmc | e583e196f9ca633bf783023433eed3cff58831b1 | [
"MIT"
] | null | null | null | """Console script for mspsmc."""
import argparse
import sys
def main():
"""Console script for mspsmc."""
parser = argparse.ArgumentParser()
parser.add_argument("_", nargs="*")
args = parser.parse_args()
print("Arguments: " + str(args._))
print("Replace this message by putting your code into "... | 22.263158 | 78 | 0.647754 | import argparse
import sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument("_", nargs="*")
args = parser.parse_args()
print("Arguments: " + str(args._))
print("Replace this message by putting your code into " "mspsmc.cli.main")
return 0
if __name__ == "__main__":
sys.... | true | true |
f710d60d223dd89617b941d4998103be022a0f2f | 2,689 | py | Python | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 75 | 2020-07-20T20:54:00.000Z | 2022-03-09T09:18:37.000Z | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 3 | 2020-09-13T00:46:49.000Z | 2021-07-06T16:18:22.000Z | centroids/challenge/ImageGen.py | cypher-me/HAS-Qualifier-Challenges | bb795303716155dad4a930880a58fecb5d9b50c5 | [
"MIT"
] | 14 | 2020-07-22T16:34:51.000Z | 2021-09-13T12:19:59.000Z | from scipy import signal
from scipy import misc
from scipy import stats as st
import numpy as np
W = 128
L = 128
Body_Width = 3
Border = Body_Width+1
Points = 10
Noise_Max = 10
Body_Separation = 15
Body_Scale = 30
OvScale = 3
def gkern(kernlen=21, nsig=3):
''' 2D Gaussian Kernel. '''
x = np.linspace(-nsig, n... | 30.908046 | 103 | 0.533284 | from scipy import signal
from scipy import misc
from scipy import stats as st
import numpy as np
W = 128
L = 128
Body_Width = 3
Border = Body_Width+1
Points = 10
Noise_Max = 10
Body_Separation = 15
Body_Scale = 30
OvScale = 3
def gkern(kernlen=21, nsig=3):
x = np.linspace(-nsig, nsig, kernlen+1)
kern1d = np.... | true | true |
f710d6aeca2fcb946784031b7aef37d3f0c06494 | 6,234 | py | Python | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | encord/configs.py | encord-team/cord-client-python | fe7833f1d51db7cc8a2a362e632fc7dcf4ba6e81 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Cord Technologies Limited
#
# 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 ag... | 32.300518 | 114 | 0.694097 |
import hashlib
import logging
import os
from abc import ABC, abstractmethod
from pickle import NONE
from typing import Dict, Optional
import cryptography
from cryptography.hazmat.primitives.asymmetric.ed25519 import (
Ed25519PrivateKey,
Ed25519PublicKey,
)
from cryptography.hazmat.primitives.seri... | true | true |
f710d6ff7602b53a29430a9106346782ca0b25c2 | 6,973 | py | Python | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2022-03-01T02:26:40.000Z | 2022-03-15T02:33:38.000Z | lib/spack/spack/schema/modules.py | Nabil-AL/spack | 442d0725fe9726597c7c88274d379c0c994d926b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # 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)
"""Schema for modules.yaml configuration file.
.. literalinclude:: _spack_root/lib/spack/spack/schema/modules.py
:line... | 30.056034 | 83 | 0.514986 |
import spack.schema.environment
import spack.schema.projections
spec_regex = r'(?!hierarchy|core_specs|verbose|hash_length|whitelist|' \
r'blacklist|projections|naming_scheme|core_compilers|all|' \
r'defaults)(^\w[\w-]*)'
set_regex = r'(?!enable|lmod|tcl|dotkit|prefix_inspections... | true | true |
f710d79c09a9b0679214160018290771969fcba6 | 8,930 | py | Python | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-02-20T21:22:07.000Z | 2021-02-20T21:22:07.000Z | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/watchdog/observers/inotify.py | lukassup/watchdog | db45bb7923e1e0226b741e521890832e216270e2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 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
#
# ... | 39.166667 | 107 | 0.676708 |
from __future__ import with_statement
import os
import threading
from .inotify_buffer import InotifyBuffer
from watchdog.observers.api import (
EventEmitter,
BaseObserver,
DEFAULT_EMITTER_TIMEOUT,
DEFAULT_OBSERVER_TIMEOUT
)
from watchdog.events import (
DirDeletedEvent,
Dir... | true | true |
f710d8153f1f5aeb27c355a1c1823ae88d30208e | 497 | py | Python | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/lightposition/_z.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="z", parent_name="isosurface.lightposition", **kwargs
):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | 31.0625 | 79 | 0.617706 | import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="z", parent_name="isosurface.lightposition", **kwargs
):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | true | true |
f710d8a784792856aa8454aaa89c6b339c6e43ed | 4,369 | py | Python | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T22:45:14.000Z | 2021-12-15T22:45:14.000Z | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/tests/base/checks/openmetrics/test_interface.py | tdimnet/integrations-core | a78133a3b71a1b8377fa214d121a98647031ab06 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.constants import ServiceCheck
from datadog_checks.dev.testing import requires_py3
from .utils import get_chec... | 36.714286 | 114 | 0.688487 |
import pytest
from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.constants import ServiceCheck
from datadog_checks.dev.testing import requires_py3
from .utils import get_check
pytestmark = [requires_py3, pytest.mark.openmetrics, pytest.mark.openmetrics_interface]
def test_default_co... | true | true |
f710d923ceb89999ceccd02025d68644894d3817 | 16,027 | py | Python | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | models/Strategy.py | bsda/pycryptobot | 8d0738cc06bef165d335b08ad8597777a229ed81 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from pandas import DataFrame
from models.PyCryptoBot import PyCryptoBot
from models.AppState import AppState
from models.helper.LogHelper import Logger
import sys
class Strategy:
def __init__(
self,
app: PyCryptoBot = None,
state: AppState = AppState,
... | 39.670792 | 179 | 0.540525 | from datetime import datetime
from pandas import DataFrame
from models.PyCryptoBot import PyCryptoBot
from models.AppState import AppState
from models.helper.LogHelper import Logger
import sys
class Strategy:
def __init__(
self,
app: PyCryptoBot = None,
state: AppState = AppState,
... | true | true |
f710d9d3bac610cb12378ee562e63296d1c01fe2 | 3,167 | py | Python | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 23 | 2015-08-03T23:28:54.000Z | 2018-12-12T20:11:45.000Z | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 1 | 2018-09-30T18:18:24.000Z | 2018-09-30T18:18:24.000Z | byceps/services/shop/order/actions/ticket.py | homeworkprod/byceps | cd0f9f37f7b5eb517106ec761acc7e0bdf75e22e | [
"BSD-3-Clause"
] | 9 | 2015-08-06T16:41:36.000Z | 2018-09-25T11:17:31.000Z | """
byceps.services.shop.order.actions.ticket
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from typing import Any, Sequence
from uuid import UUID
from .....typing import UserID
from ....ticketing.dbmodels.ticket impor... | 28.276786 | 80 | 0.703189 |
from typing import Any, Sequence
from uuid import UUID
from .....typing import UserID
from ....ticketing.dbmodels.ticket import Ticket
from ....ticketing import (
category_service as ticket_category_service,
ticket_creation_service,
ticket_revocation_service,
ticket_service,
)
from ....ticketing.tran... | true | true |
f710da033824699bdb11c30cb57fc8866b1aa4a0 | 19,600 | py | Python | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | pde/trackers/trackers.py | xuanxu/py-pde | de33d938aea8680eff872ae1b64569895662a248 | [
"MIT"
] | null | null | null | """
Module defining classes for tracking results from simulations.
The trackers defined in this module are:
.. autosummary::
:nosignatures:
CallbackTracker
ProgressTracker
PrintTracker
PlotTracker
DataTracker
SteadyStateTracker
RuntimeTracker
ConsistencyTracker
MaterialConservationTrack... | 35.507246 | 80 | 0.567194 |
from datetime import timedelta
import inspect
import sys
import time
from typing import Callable, Optional, Union, IO, List, Any
import numpy as np
from .base import TrackerBase, InfoDict, FinishedSimulation, Real
from .intervals import IntervalData, RealtimeIntervals
from ..fields.base import FieldBase
from ..fie... | true | true |
f710dadd1226258b991a79823b61c58c911a15f1 | 11,987 | py | Python | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | 64 | 2021-11-15T03:48:00.000Z | 2022-03-25T07:08:46.000Z | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Zhang-SJ930104/ymir | dd6481be6f229ade4cf8fba64ef44a15357430c4 | [
"Apache-2.0"
] | 35 | 2021-11-23T04:14:35.000Z | 2022-03-26T09:03:43.000Z | ymir/command/tests/unit/test_tools_ark_data_exporter.py | Aryalfrat/ymir | d4617ed00ef67a77ab4e1944763f608bface4be6 | [
"Apache-2.0"
] | 57 | 2021-11-11T10:15:40.000Z | 2022-03-29T07:27:54.000Z | import os
import shutil
from typing import List, Tuple
import unittest
from google.protobuf import json_format
from mir.protos import mir_command_pb2 as mirpb
from mir.tools import data_exporter, hash_utils, mir_storage_ops
from tests import utils as test_utils
class TestArkDataExporter(unittest.TestCase):
# li... | 43.908425 | 119 | 0.45858 | import os
import shutil
from typing import List, Tuple
import unittest
from google.protobuf import json_format
from mir.protos import mir_command_pb2 as mirpb
from mir.tools import data_exporter, hash_utils, mir_storage_ops
from tests import utils as test_utils
class TestArkDataExporter(unittest.TestCase):
... | true | true |
f710de29749798d1f874e2fbb0b328d3f88f44de | 5,035 | py | Python | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py | rajeshwariC/WeVoteServer | 59aff1725b7586ebd360ef40fc1b44e5a0b9572d | [
"MIT"
] | null | null | null | # apis_v1/documentation_source/sitewide_daily_metrics_sync_out_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def sitewide_daily_metrics_sync_out_doc_template_values(url_root):
"""
Show documentation about sitewideDailyMetricsSyncOut
"""
required_query_parameter_list = [
... | 48.413462 | 118 | 0.554916 |
def sitewide_daily_metrics_sync_out_doc_template_values(url_root):
required_query_parameter_list = [
{
'name': 'api_key',
'value': 'string (from post, cookie, or get (in that order))',
'description': 'The unique key provided to any organization usin... | true | true |
f710de970e7fba982966b7b605985bbabc605981 | 447 | py | Python | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | bibliohub/catalog/urls.py | apjanco/bibliohub | 95da034d2e136bd4ae25a9b6932fd19124dacd9b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
from .views import SearchResultsView, HomePageView
urlpatterns = [
path('', views.index, name='index'),
# path('books/', views.BookListView.as_view(), name='books'),
path('search/', SearchResultsView.as_view(), name='search_results'),
path('home/', HomePa... | 44.7 | 94 | 0.711409 | from django.urls import path
from . import views
from .views import SearchResultsView, HomePageView
urlpatterns = [
path('', views.index, name='index'),
path('search/', SearchResultsView.as_view(), name='search_results'),
path('home/', HomePageView.as_view(),name='home'),
] | true | true |
f710e12932440d3e0decd6e77f4a75490177b6e2 | 14,465 | py | Python | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:30:57.000Z | 2016-08-27T18:30:57.000Z | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | null | null | null | pgmpy/readwrite/XMLBIF.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:31:00.000Z | 2016-08-27T18:31:00.000Z | #!/usr/bin/env python
try:
from lxml import etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
#try:
# import xml.etree.cElementTree as etree
# commented out because xml.etree.cElementTree is giving errors with dictionary attribute... | 35.109223 | 117 | 0.55382 |
try:
from lxml import etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
print("Failed to import ElementTree from any known place")
import numpy as np
from pgmpy.models import BayesianModel
from pgmpy.factors import... | true | true |
f710e191022a1dfd9848a7665725db9fc3dd3f11 | 1,818 | py | Python | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | 3 | 2021-04-15T16:48:07.000Z | 2021-08-17T10:58:37.000Z | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | null | null | null | dev.py | pkeilbach/pyredis | 3bc019e8e366ab1c4705dba5254a852476069e46 | [
"MIT"
] | null | null | null | from pyredis import RedisConnection
from pprint import pprint
# 1. Object Creation
# pass everything you would pass to redis.Redis()
redis_args = {
'host': 'localhost',
# 'password': 'redis1234',
# 'port': 1234,
}
with RedisConnection(**redis_args) as my_redis:
my_redis.set('key', 'value')
# 2. Red... | 30.3 | 85 | 0.689769 | from pyredis import RedisConnection
from pprint import pprint
redis_args = {
'host': 'localhost',
}
with RedisConnection(**redis_args) as my_redis:
my_redis.set('key', 'value')
with RedisConnection(**redis_args) as my_redis:
my_redis.set('a_sting', 'my_sting value')
my_redis.set('a_li... | true | true |
f710e20958dad9de518259a06788cf29354580c5 | 2,293 | py | Python | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2020-11-24T03:17:21.000Z | 2020-11-24T03:17:21.000Z | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | null | null | null | UVa 10020 - Minimal Coverage/sample/main.py | tadvi/uva | 0ac0cbdf593879b4fb02a3efc09adbb031cb47d5 | [
"MIT"
] | 1 | 2021-04-11T16:22:31.000Z | 2021-04-11T16:22:31.000Z | '''
Created on Jul 17, 2013
@author: Yubin Bai
'''
import time
from multiprocessing.pool import Pool
parallelSolve = False
INF = 1 << 31
def solve(par):
M, pairs = par
pairs.sort()
pairs1 = []
for p in pairs:
if p[0] >= M or p[1] <= 0:
continue
pairs1.append(tuple(p))
i... | 26.356322 | 64 | 0.516354 | import time
from multiprocessing.pool import Pool
parallelSolve = False
INF = 1 << 31
def solve(par):
M, pairs = par
pairs.sort()
pairs1 = []
for p in pairs:
if p[0] >= M or p[1] <= 0:
continue
pairs1.append(tuple(p))
if not pairs1:
return 0
pairs = [pairs1[... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.