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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7158d1fdb4e339a2eeef76b607b2b96c5f92797 | 11,206 | py | Python | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 78 | 2020-08-04T12:36:25.000Z | 2022-03-25T04:23:40.000Z | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 1 | 2020-08-12T09:47:19.000Z | 2020-08-12T09:47:19.000Z | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 25 | 2020-08-31T12:21:19.000Z | 2022-03-20T05:16:32.000Z | # Copyright 2019 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... | 34.374233 | 80 | 0.663127 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import threading
import time
from absl import logging
from tensorflow.python.distribute import multi_process_runner
from tensorflow.python.distribute import multi_worker_te... | true | true |
f7158d5e6cf2a8dfdb996beebce53453c96ec708 | 281 | py | Python | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | null | null | null | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | null | null | null | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | 1 | 2021-07-18T03:52:40.000Z | 2021-07-18T03:52:40.000Z | import json
import pandas as pd
def handler(event, context):
df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
print(df)
return {
"statusCode": 200,
"body": json.dumps({
"message": "This is a container lambda."
})
}
| 17.5625 | 62 | 0.512456 | import json
import pandas as pd
def handler(event, context):
df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
print(df)
return {
"statusCode": 200,
"body": json.dumps({
"message": "This is a container lambda."
})
}
| true | true |
f7158d9cf34dc0b5ca5dc19e15a61f7fd3e08c77 | 12,588 | py | Python | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter.ttk import *
import sqlite3
from tkinter import *
'''
import speech_recognition as sr # for speech recognition to play songs
import pyttsx3 as tts # python module for speech
engine = tts.init()
volume = engine.getProperty('volume')
engine.setProperty('volume',0.75)
voices = engine.g... | 33.03937 | 398 | 0.640133 | import tkinter as tk
from tkinter.ttk import *
import sqlite3
from tkinter import *
root = tk.Tk()
root.title("DataBase Manager by Mohit Gupta")
root.geometry("800x640")
songs = Entry(root, width=50)
songs.grid(row=8,column=1,pady=5)
age0_2 = Entry(root, width=50)
age0_2.grid(row=9, column=1,pady=5)
age4_6 = En... | true | true |
f7158e044b9155a5343668120d5af436908eaa72 | 8,428 | py | Python | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#-*- coding: utf-8 -*-
# Video 25 FPS, Audio 16000HZ
import torch
import numpy
import time, pdb, argparse, subprocess, os, math, glob
import cv2
import python_speech_features
from scipy import signal
from scipy.io import wavfile
from SyncNetModel import *
from shutil import rmtree
# ==============... | 32.666667 | 154 | 0.51495 |
import torch
import numpy
import time, pdb, argparse, subprocess, os, math, glob
import cv2
import python_speech_features
from scipy import signal
from scipy.io import wavfile
from SyncNetModel import *
from shutil import rmtree
def get_median(data1):
data = sorted(data1)
size = len(data)
if size % 2 =... | true | true |
f7158e76c232bf5249188b7a0fe3dc8f0b03f00c | 405 | py | Python | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 70 | 2017-06-14T16:48:51.000Z | 2022-03-15T02:44:14.000Z | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 20 | 2018-06-04T12:06:30.000Z | 2021-09-10T14:01:25.000Z | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 47 | 2017-10-31T23:51:19.000Z | 2022-03-23T12:38:48.000Z | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['turtl... | 28.928571 | 70 | 0.780247 | s_setup(
packages=['turtlebot3_automatic_parking_vision'],
package_dir={'': 'src'}
)
setup(**setup_args)
| true | true |
f7158e77cbc37e40ac0788e476409ce0f922c325 | 5,748 | py | Python | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 3 | 2021-08-20T16:40:09.000Z | 2022-02-08T23:17:52.000Z | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 1 | 2022-03-22T04:16:15.000Z | 2022-03-22T04:26:03.000Z | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 1 | 2021-04-28T21:51:12.000Z | 2021-04-28T21:51:12.000Z | from __future__ import absolute_import, division, print_function
import os
import sys
import tensorflow.compat.v1 as tfv1
from attrdict import AttrDict
from xdg import BaseDirectory as xdg
from src.flags import FLAGS
from .gpu import get_available_gpus
from .logging import log_error
from .text import Alphabet, UTF8A... | 38.066225 | 108 | 0.677279 | from __future__ import absolute_import, division, print_function
import os
import sys
import tensorflow.compat.v1 as tfv1
from attrdict import AttrDict
from xdg import BaseDirectory as xdg
from src.flags import FLAGS
from .gpu import get_available_gpus
from .logging import log_error
from .text import Alphabet, UTF8A... | true | true |
f715901de4244e706505bcbc2ad3c07df8e07766 | 5,685 | py | Python | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 23.491736 | 74 | 0.65277 |
import _collections
import sys
class chain(object):
def from_iterable(cls, iterables):
for it in iterables:
for element in it:
yield element
from_iterable = classmethod(from_iterable)
def __init__(self, *iterables):
if not iterables:
self.iterables = iter([[]])
e... | true | true |
f7159091f18210b97ef9f6170f617a8643d4d010 | 1,414 | py | Python | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 1 | 2018-09-17T13:57:55.000Z | 2018-09-17T13:57:55.000Z | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 3 | 2018-10-02T10:05:12.000Z | 2018-10-10T09:33:47.000Z | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 3 | 2018-08-15T16:50:51.000Z | 2018-09-26T08:52:44.000Z | import json, os
from threading import Thread
from tornado.ioloop import IOLoop
import tornado.web
from hbi.model import Host, Filter
from hbi.server import Service
class RootHandler(tornado.web.RequestHandler):
def get(self):
self.write("boop")
class EntitiesPoster(tornado.web.RequestHandler):
d... | 25.709091 | 87 | 0.66761 | import json, os
from threading import Thread
from tornado.ioloop import IOLoop
import tornado.web
from hbi.model import Host, Filter
from hbi.server import Service
class RootHandler(tornado.web.RequestHandler):
def get(self):
self.write("boop")
class EntitiesPoster(tornado.web.RequestHandler):
d... | true | true |
f71590e5707ba2a3e6cb07b4a5957c674ad9a1d3 | 4,112 | py | Python | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-03-12T21:38:32.000Z | 2021-11-06T15:26:56.000Z | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 33 | 2019-01-21T15:54:50.000Z | 2021-05-18T17:54:52.000Z | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-01-21T15:47:26.000Z | 2021-09-22T07:14:34.000Z | from django.core.management.base import BaseCommand, CommandError
from simple_history.models import HistoricalRecords
from members.models import User
from members.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.conf import settings
from django.core.mail import EmailMessage
impor... | 33.16129 | 156 | 0.56785 | from django.core.management.base import BaseCommand, CommandError
from simple_history.models import HistoricalRecords
from members.models import User
from members.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.conf import settings
from django.core.mail import EmailMessage
impor... | true | true |
f7159115d342958270b72c812e03dd46e1a80fe8 | 23,723 | py | Python | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | 2 | 2020-09-30T21:42:35.000Z | 2020-11-21T17:58:40.000Z | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | null | null | null | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: experiment_collection_core/service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _ref... | 39.21157 | 2,040 | 0.75842 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.protobuf import timestamp_pb2 as google_dot_... | true | true |
f715925d591bd9957fdc6799ded885a4c997bb33 | 6,877 | py | Python | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | 2 | 2022-03-06T06:05:24.000Z | 2022-03-10T09:08:08.000Z | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | #############################################################
# win10 64bit
# python 3.9.6
#
# author: toush1 (20373944 he tianran)
#############################################################
import os
import re
# software path
xilinxPath = "G:\\ISE\\ise\\14.7\\ISE_DS\\ISE\\"
marsPath = "G:\\mars\\Mars... | 40.452941 | 138 | 0.54137 | out.write("\tmyLogs is too long\n")
print("\tmyLogs is too long")
return False
return True
initISE(myPrjPath)
initISE(otherPrjPath)
testdataPath = myPrjPath + "my_files\\test\\data\\"
cmpResPath = testdataPath + "cmp_res.txt"
myTbPath = myPrjPath + "my_files\\cpu\\mips_t... | true | true |
f715928065109e697649bf15722ccc0e6c0edfa4 | 7,114 | py | Python | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | null | null | null | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T22:05:26.000Z | 2022-03-21T22:05:26.000Z | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import pytest
from api.cas import casadm
from api.cas.cache_config import (
CacheMode,
CacheLineSize,
SeqCutOffPolicy,
CleaningPolicy,
CacheStatus,
)
from core.test_run import TestRun
from storage_devices.disk i... | 38.247312 | 100 | 0.66826 |
import pytest
from api.cas import casadm
from api.cas.cache_config import (
CacheMode,
CacheLineSize,
SeqCutOffPolicy,
CleaningPolicy,
CacheStatus,
)
from core.test_run import TestRun
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
from test_tools.device_mapper import... | true | true |
f71592ac0589f8a0a4e9faf12a0a0f6c0ac061b2 | 2,240 | py | Python | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | 1 | 2021-12-09T15:10:50.000Z | 2021-12-09T15:10:50.000Z | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | null | null | null | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | null | null | null | from typing import Any, Mapping, Sequence
from urllib.parse import unquote_plus
import bleach
from importo.fields.base import Field
from importo.utils.html import tidy_html
class HTMLField(Field):
allowed_tags = [
"a",
"abbr",
"acronym",
"b",
"bdi",
"blockquote",
... | 27.317073 | 84 | 0.537054 | from typing import Any, Mapping, Sequence
from urllib.parse import unquote_plus
import bleach
from importo.fields.base import Field
from importo.utils.html import tidy_html
class HTMLField(Field):
allowed_tags = [
"a",
"abbr",
"acronym",
"b",
"bdi",
"blockquote",
... | true | true |
f71595154e1ed423c34fbdbea424fd5fd9cd6d53 | 1,245 | py | Python | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | 2 | 2019-10-29T07:41:38.000Z | 2020-01-31T16:46:15.000Z | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | null | null | null | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | 2 | 2019-04-23T04:40:07.000Z | 2020-02-17T09:11:48.000Z | from django.conf import settings
def global_settings(request):
""" Return custom constant global variables to be
used widely for all of our apps. """
# Current user logged in info
cur_user_id = 0
cur_user_name = ''
cur_user_full_name = ''
if request.user.is_authenticated:
... | 35.571429 | 84 | 0.665863 | from django.conf import settings
def global_settings(request):
cur_user_id = 0
cur_user_name = ''
cur_user_full_name = ''
if request.user.is_authenticated:
cur_user_id = request.user.id
cur_user_name = request.user.username
cur_user_full_name = reque... | true | true |
f7159641e3e977f8f51e5cc647c57a31d0966efe | 1,025 | py | Python | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 1 | 2021-08-02T23:33:50.000Z | 2021-08-02T23:33:50.000Z | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 61 | 2021-08-03T00:13:24.000Z | 2021-08-20T17:38:36.000Z | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 1 | 2021-08-22T03:32:42.000Z | 2021-08-22T03:32:42.000Z | # flake8: noqa
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects import postgresql
db = SQLAlchemy()
class UserModel(db.Model):
__tablename__ = "user"
username = db.Column(db.String(36), primary_key=True)
password = db.Column(db.String(30))
def __init__(self, username, password):
... | 27.702703 | 72 | 0.693659 |
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects import postgresql
db = SQLAlchemy()
class UserModel(db.Model):
__tablename__ = "user"
username = db.Column(db.String(36), primary_key=True)
password = db.Column(db.String(30))
def __init__(self, username, password):
self.user... | true | true |
f715967f3c28b129f56ec6481c8bda553b44d472 | 963 | py | Python | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.392857 | 74 | 0.73001 |
from ..model_type_getter import get_model_type
from .model import TensorflowModel as TFModel
class FrozenPbModel(TFModel):
@staticmethod
def supports_path(path: str) -> bool:
return "frozen_pb" == get_model_type(path)
| true | true |
f715970fd90159b33cf104a6f896c9d635be8d7d | 981 | py | Python | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | null | null | null | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | 10 | 2018-03-22T09:21:11.000Z | 2018-04-11T08:50:58.000Z | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | 2 | 2018-03-30T09:52:48.000Z | 2018-04-11T13:13:36.000Z | from bigcoin import bc_kafka,bc_elasticsearch
import json
import datetime
import signal
def generate_elastic_insert_from_messages(messages):
for message in messages:
json_message = json.loads(message)
#value are in satoshi
yield {
'_index' : 'transaction_idx',
'_type': 'transaction',
'_id': json_messag... | 26.513514 | 100 | 0.746177 | from bigcoin import bc_kafka,bc_elasticsearch
import json
import datetime
import signal
def generate_elastic_insert_from_messages(messages):
for message in messages:
json_message = json.loads(message)
yield {
'_index' : 'transaction_idx',
'_type': 'transaction',
'_id': json_message['index'],
'_sour... | true | true |
f715986ba969fafbf1bb6c8a7b6a6295ca3828db | 1,546 | py | Python | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | from mltemplate.ci.core import Stage
from mltemplate.ci.jobs import BumpVersionJob, PypiDeployJob, RunTestsJob, StyleCheckJob
class BumpVersionStage(Stage):
def __init__(self, name="bump-version", **kwargs):
super(BumpVersionStage, self).__init__(
name=name, jobs=[BumpVersionJob(stage=name, **... | 35.136364 | 94 | 0.650065 | from mltemplate.ci.core import Stage
from mltemplate.ci.jobs import BumpVersionJob, PypiDeployJob, RunTestsJob, StyleCheckJob
class BumpVersionStage(Stage):
def __init__(self, name="bump-version", **kwargs):
super(BumpVersionStage, self).__init__(
name=name, jobs=[BumpVersionJob(stage=name, **... | true | true |
f7159a946ae2267a79e3a78a56dd34aec97345e1 | 1,130 | py | Python | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 2 | 2018-09-11T21:09:22.000Z | 2018-10-05T08:35:58.000Z | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 24 | 2018-09-09T22:51:26.000Z | 2018-11-29T22:49:57.000Z | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 1 | 2018-10-16T20:01:20.000Z | 2018-10-16T20:01:20.000Z | class Event(object):
""" Represents a GUI event. """
def __init__(self, tk_event):
"""
Args:
tk_event: The underlying Tkinter event to wrap. """
self._tk_event = tk_event
@classmethod
def get_identifier(cls):
"""
Returns:
The Tkinter identifier for this event. """
raise Not... | 24.042553 | 80 | 0.676106 | class Event(object):
def __init__(self, tk_event):
self._tk_event = tk_event
@classmethod
def get_identifier(cls):
raise NotImplementedError("Must be implemented by subclass.")
class MouseEvent(Event):
def get_pos(self):
return (self._tk_event.x, self._tk_event.y)
class MouseDragEvent(MouseEven... | true | true |
f7159b75d0cdb78ddc25a9f3959376ef6d82d188 | 16,663 | py | Python | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | import abc
import logging
from connexion.operations.secure import SecureOperation
from ..decorators.metrics import UWSGIMetricsCollector
from ..decorators.parameter import parameter_to_arg
from ..decorators.produces import BaseSerializer, Produces
from ..decorators.response import ResponseValidator
from ..decorators.... | 34.932914 | 120 | 0.63434 | import abc
import logging
from connexion.operations.secure import SecureOperation
from ..decorators.metrics import UWSGIMetricsCollector
from ..decorators.parameter import parameter_to_arg
from ..decorators.produces import BaseSerializer, Produces
from ..decorators.response import ResponseValidator
from ..decorators.... | true | true |
f7159bc7a6e447bf791158449870039af24b7945 | 2,451 | py | Python | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 619 | 2015-01-14T23:50:18.000Z | 2019-11-08T14:04:33.000Z | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 576 | 2015-01-02T09:55:14.000Z | 2019-11-12T15:31:10.000Z | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 494 | 2015-01-14T18:33:56.000Z | 2019-11-07T10:08:15.000Z | #!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016-2017 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# ... | 35.521739 | 83 | 0.696042 |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_lis2ds12 as sensorObj
def main():
sensor = sensorObj.LIS2DS12()
GINTHandler(signum, frame):
raise SystemExit
def exitHandler():
print("Exiting")
... | true | true |
f7159c0f90f16cb4e374669e5d3e907a7304876f | 8,515 | py | Python | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 18 | 2021-11-30T15:19:53.000Z | 2022-03-30T15:15:57.000Z | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 2 | 2021-12-10T06:38:18.000Z | 2022-03-27T21:45:53.000Z | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 3 | 2021-12-01T06:25:52.000Z | 2022-01-21T14:13:51.000Z | from functools import partial
import torch
import random
import numpy as np
from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...utils import common_utils, box_utils
from . import augmentor_utils, database_sampler
class DataAugmentor(object):
def __init__(self, root_path, augmentor_configs, class_name... | 40.165094 | 121 | 0.622548 | from functools import partial
import torch
import random
import numpy as np
from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...utils import common_utils, box_utils
from . import augmentor_utils, database_sampler
class DataAugmentor(object):
def __init__(self, root_path, augmentor_configs, class_name... | true | true |
f7159c350fdf2aa74b7565b424ed07b5ef99b118 | 733 | py | Python | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 18 | 2017-03-08T06:30:55.000Z | 2020-05-08T17:30:20.000Z | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 871 | 2017-03-06T21:03:59.000Z | 2022-03-28T19:46:44.000Z | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 5 | 2017-07-07T12:10:47.000Z | 2020-05-13T15:57:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-29 07:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0009_auto_20170617_1557'),
]
operations = [
migrations.AddField... | 28.192308 | 113 | 0.618008 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0009_auto_20170617_1557'),
]
operations = [
migrations.AddField(
model_name='category',
name='name_en',
... | true | true |
f7159d3af512db4cfc343827849b64501a5eca32 | 2,770 | py | Python | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | null | null | null | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | 11 | 2020-06-05T22:50:37.000Z | 2022-02-10T09:05:56.000Z | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | null | null | null | # Librerias Django
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
... | 33.780488 | 88 | 0.648014 |
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
from ..submodels... | true | true |
f7159d5a2d920dc9cc5bb8cc18005b68413166a5 | 2,828 | py | Python | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_conv2d(m, x, y):
# TODO: add support for pad and dilation
x = x[0]
cin = m.in_channels
cout = m.out_channels
kh, kw = m.kernel_size
batch_size = x.size()[0]
out_w = y.size(2)
out_h = y.size(3)
# ops per output element
# kern... | 22.624 | 61 | 0.684936 | import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_conv2d(m, x, y):
x = x[0]
cin = m.in_channels
cout = m.out_channels
kh, kw = m.kernel_size
batch_size = x.size()[0]
out_w = y.size(2)
out_h = y.size(3)
kernel_ops = multiply_adds * kh * kw * cin // m.groups
bias_ops =... | true | true |
f7159d9791448f06c36331ba8b9839a880d17d19 | 4,281 | py | Python | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | 38.918182 | 122 | 0.723896 |
import os
import sys
from ambari_agent.ClusterConfigurationCache import ClusterConfigurationCache
from mock.mock import MagicMock, patch, mock_open, ANY
from unittest import TestCase
class TestClusterConfigurationCache(TestCase):
o_flags = os.O_WRONLY | os.O_CREAT
perms = 0o600
def setUp(self):
s... | true | true |
f7159dc06a6352dac967128fe0aa532b3e17b5a1 | 355 | py | Python | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | from random import randint
alist = list() # []
list('hello') # ['h', 'e', 'l', 'l', 'o']
list((10, 20, 30)) # [10, 20, 30] 元组转列表
astr = str() # ''
str(10) # '10'
str(['h', 'e', 'l', 'l', 'o']) # 将列表转成字符串
atuple = tuple() # ()
tuple('hello') # ('h', 'e', 'l', 'l', 'o')
num_list = [randint(1, 100) for i in rang... | 25.357143 | 47 | 0.498592 | from random import randint
alist = list()
list('hello')
list((10, 20, 30))
astr = str()
str(10)
str(['h', 'e', 'l', 'l', 'o'])
atuple = tuple()
tuple('hello')
num_list = [randint(1, 100) for i in range(10)]
max(num_list)
min(num_list)
| true | true |
f7159dfd3e5220cdf838857e63b85ecb77e79ba3 | 11,938 | py | Python | venv/Lib/site-packages/praw/endpoints.py | Dartok-SD/Dartok-SD-s-reddit-bot | dc7a3215c062ed95b9f44bc207383e776c1692ea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/praw/endpoints.py | Dartok-SD/Dartok-SD-s-reddit-bot | dc7a3215c062ed95b9f44bc207383e776c1692ea | [
"MIT"
] | 1 | 2020-11-26T18:38:13.000Z | 2020-11-27T15:25:49.000Z | praw/endpoints.py | leviroth/praw | 8f05dd2a9188cbaf1fba067e429ad6552d952059 | [
"BSD-2-Clause"
] | null | null | null | """List of API endpoints PRAW knows about."""
# flake8: noqa
# fmt: off
API_PATH = {
"about_edited": "r/{subreddit}/about/edited/",
"about_log": "r/{subreddit}/about/log/",
"about_modqueue": "r/{subreddit}/about/modqueue/",
"about_reports": "r/{subreddit}/abo... | 58.234146 | 82 | 0.554951 |
API_PATH = {
"about_edited": "r/{subreddit}/about/edited/",
"about_log": "r/{subreddit}/about/log/",
"about_modqueue": "r/{subreddit}/about/modqueue/",
"about_reports": "r/{subreddit}/about/reports/",
"about_spam": "r/{subreddit}/about/spam... | true | true |
f7159f9ba44b38e5dac9b34e58d1d994a96098c0 | 5,561 | py | Python | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 278 | 2015-02-12T19:19:53.000Z | 2022-03-22T21:17:28.000Z | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 56 | 2015-03-27T00:38:37.000Z | 2022-03-26T17:52:58.000Z | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 48 | 2015-03-10T16:50:19.000Z | 2022-03-20T12:11:50.000Z | import json
import os
import shutil
import tempfile
from unittest import TestCase
from ...bencode import bdecode
from ..transmission import TransmissionClient as RealTransmissionClient
current_path = os.path.dirname(__file__)
class TransmissionClient(RealTransmissionClient):
def __init__(self, *args, **kwargs... | 36.827815 | 182 | 0.58209 | import json
import os
import shutil
import tempfile
from unittest import TestCase
from ...bencode import bdecode
from ..transmission import TransmissionClient as RealTransmissionClient
current_path = os.path.dirname(__file__)
class TransmissionClient(RealTransmissionClient):
def __init__(self, *args, **kwargs... | true | true |
f715a037d80404b6931c2c3dd6c455b1ba329594 | 4,755 | py | Python | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | #coding=utf-8
from __future__ import print_function
import time
import argparse
from glob import glob
import os, cv2
import json
def show(image_path, bbox):
print(image_path, bbox)
im = cv2.imread(image_path)
x, y, w, h = bbox
# left = int(x - w / 2)
# right = int(x + w / 2)
# top = int(y - h... | 30.677419 | 146 | 0.512303 |
from __future__ import print_function
import time
import argparse
from glob import glob
import os, cv2
import json
def show(image_path, bbox):
print(image_path, bbox)
im = cv2.imread(image_path)
x, y, w, h = bbox
left = int(x)
top = int(y)
right = int(x + w)
bottom =... | true | true |
f715a131ad3bfd03cd6d8810488e273d1fd54f64 | 6,015 | py | Python | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 72 | 2018-07-02T07:47:15.000Z | 2022-03-29T10:02:14.000Z | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 51 | 2019-10-08T01:53:02.000Z | 2021-06-04T22:02:21.000Z | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 29 | 2018-09-17T06:10:32.000Z | 2022-03-19T13:15:30.000Z | import os
from datetime import datetime
from .. import auth, types, utils
class DaemonApiMixin(object):
@utils.minimum_version('1.25')
def df(self):
"""
Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and th... | 33.049451 | 79 | 0.571904 | import os
from datetime import datetime
from .. import auth, types, utils
class DaemonApiMixin(object):
@utils.minimum_version('1.25')
def df(self):
url = self._url('/system/df')
return self._result(self._get(url), True)
def events(self, since=None, until=None, filters=None, decode=None)... | true | true |
f715a15885e13fd0957f648c1414a90e72a239ca | 10,690 | py | Python | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 26 | 2021-11-05T08:46:06.000Z | 2022-03-22T05:53:57.000Z | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 1 | 2021-11-19T11:13:37.000Z | 2021-11-30T09:08:04.000Z | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 5 | 2021-11-05T08:46:12.000Z | 2022-03-25T21:56:58.000Z | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common import logger
from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm
from stable_baselines3.common.type_aliases import GymEnv,... | 43.279352 | 110 | 0.659682 | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common import logger
from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm
from stable_baselines3.common.type_aliases import GymEnv,... | true | true |
f715a21938d09961aef70bbfb712b4ac4b78ccb3 | 2,266 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | from spinnman.messages.scp.abstract_messages.abstract_scp_request\
import AbstractSCPRequest
from spinnman.messages.scp.impl.scp_sdram_alloc_response import \
SCPSDRAMAllocResponse
from spinnman.messages.sdp.sdp_header import SDPHeader
from spinnman.messages.sdp.sdp_flag import SDPFlag
from spinnman.messages.sc... | 39.068966 | 79 | 0.644307 | from spinnman.messages.scp.abstract_messages.abstract_scp_request\
import AbstractSCPRequest
from spinnman.messages.scp.impl.scp_sdram_alloc_response import \
SCPSDRAMAllocResponse
from spinnman.messages.sdp.sdp_header import SDPHeader
from spinnman.messages.sdp.sdp_flag import SDPFlag
from spinnman.messages.sc... | true | true |
f715a27d0c9909bea75ea1edd3eb15e6bba3b9a4 | 5,102 | py | Python | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | import re
from .._compat import PY2, iteritems, integer_types, to_unicode, long
from .._globals import IDENTITY
from .base import SQLAdapter
from . import adapters, with_connection_or_raise
class Slicer(object):
def rowslice(self, rows, minimum=0, maximum=None):
if maximum is None:
return rows[... | 32.705128 | 75 | 0.561348 | import re
from .._compat import PY2, iteritems, integer_types, to_unicode, long
from .._globals import IDENTITY
from .base import SQLAdapter
from . import adapters, with_connection_or_raise
class Slicer(object):
def rowslice(self, rows, minimum=0, maximum=None):
if maximum is None:
return rows[... | true | true |
f715a381967b6c4678430e111919f89608f9e232 | 1,922 | py | Python | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | 8 | 2019-04-27T01:19:45.000Z | 2020-09-21T03:31:01.000Z | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | null | null | null | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | 5 | 2019-04-27T01:19:47.000Z | 2020-09-20T15:15:19.000Z | import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats.lombscargle.implementations.mle import design_matrix, periodic_fit
@pytest.fixture
def t():
rand = np.random.RandomState(42)
return 10 * rand.rand(10)
@pytest.mark.parametrize('freq', [1.0, 2])
@pytest.mark.parame... | 34.945455 | 85 | 0.605619 | import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats.lombscargle.implementations.mle import design_matrix, periodic_fit
@pytest.fixture
def t():
rand = np.random.RandomState(42)
return 10 * rand.rand(10)
@pytest.mark.parametrize('freq', [1.0, 2])
@pytest.mark.parame... | true | true |
f715a4a05c0ac41089e088d453bb1aff5563f056 | 29,345 | py | Python | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | 1 | 2019-05-23T10:08:54.000Z | 2019-05-23T10:08:54.000Z | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | null | null | null | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | 2 | 2019-05-06T01:10:41.000Z | 2019-05-06T01:10:42.000Z | from braintree.util.crypto import Crypto
from braintree.webhook_notification import WebhookNotification
import sys
if sys.version_info[0] == 2:
from base64 import encodestring as encodebytes
else:
from base64 import encodebytes
from datetime import datetime
class WebhookTestingGateway(object):
def __init__... | 43.474074 | 129 | 0.566434 | from braintree.util.crypto import Crypto
from braintree.webhook_notification import WebhookNotification
import sys
if sys.version_info[0] == 2:
from base64 import encodestring as encodebytes
else:
from base64 import encodebytes
from datetime import datetime
class WebhookTestingGateway(object):
def __init__... | true | true |
f715a55d3a4d0e4ed9e635af1fb7092bd4dc3fdc | 2,188 | py | Python | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | import argparse
import logging
import datetime
import csv
from requests.exceptions import HTTPError
from urllib3.exceptions import MaxRetryError
# local imports
from common import config
import news_page_objects as news
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def _news_scraper(n... | 29.567568 | 95 | 0.673675 | import argparse
import logging
import datetime
import csv
from requests.exceptions import HTTPError
from urllib3.exceptions import MaxRetryError
from common import config
import news_page_objects as news
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def _news_scraper(news_sites_uid):... | true | true |
f715a596a287133251f9a3c65e63acf439e485b9 | 18,541 | py | Python | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Powerbot Server
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... | 28.656878 | 372 | 0.584596 |
import pprint
import re
import six
class OrderEntry(object):
swagger_types = {
'side': 'str',
'prod': 'str',
'quantity': 'float',
'price': 'float',
'display_qty': 'int',
'contract_id': 'int',
'contract_name': 'str',
'cl_ordr_id': 'str',
... | true | true |
f715a6870b84172a6bce55c32434e579a2ef0c2a | 6,133 | py | Python | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, List, Optional
@dataclass
class Signatures:
class Meta:
name = "signatures"
w3_org_2000_09_xmldsig_element: List[object] = field(
default_factory=list,
metadata={
"type": "Wildcard",
"namespace":... | 15.806701 | 65 | 0.459971 | from dataclasses import dataclass, field
from typing import Dict, List, Optional
@dataclass
class Signatures:
class Meta:
name = "signatures"
w3_org_2000_09_xmldsig_element: List[object] = field(
default_factory=list,
metadata={
"type": "Wildcard",
"namespace":... | true | true |
f715a6b708707b2792f67edc44f6ef7fd6f14e2c | 58,348 | py | Python | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | import copy
import inspect
import itertools
import logging
import os
import warnings
from contextlib import contextmanager
from typing import NamedTuple
import torch
import torch.distributed as dist
RPC_AVAILABLE = False
if dist.is_available():
from torch.distributed.distributed_c10d import ReduceOp
from torc... | 46.015773 | 116 | 0.622935 | import copy
import inspect
import itertools
import logging
import os
import warnings
from contextlib import contextmanager
from typing import NamedTuple
import torch
import torch.distributed as dist
RPC_AVAILABLE = False
if dist.is_available():
from torch.distributed.distributed_c10d import ReduceOp
from torc... | true | true |
f715a88fabf1954be8dfa7b40347f927f0d59c06 | 362 | py | Python | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | from keras.models import load_model
import numpy as np
X = np.load("dataset/X_test.npy")
Y = np.load("dataset/Y_test.npy")
model = load_model("model")
score = model.evaluate(X, Y)
print(score[0], score[1])
# print(np.argmax(model.predict(X[:200]), axis=1))
# print(np.argmax(model.predict(X), axis=1) == np.argmax(Y... | 22.625 | 68 | 0.685083 | from keras.models import load_model
import numpy as np
X = np.load("dataset/X_test.npy")
Y = np.load("dataset/Y_test.npy")
model = load_model("model")
score = model.evaluate(X, Y)
print(score[0], score[1])
| true | true |
f715aa3a3e29c2e7729e963647247ab81b1771d1 | 7,083 | py | Python | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 3,782 | 2016-02-21T03:53:11.000Z | 2022-03-31T16:10:26.000Z | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 2,666 | 2016-02-11T01:54:54.000Z | 2022-03-31T11:14:33.000Z | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 1,597 | 2016-02-21T03:10:08.000Z | 2022-03-30T13:21:28.000Z | """
FACTOR dataset loader
"""
import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
logger = logging.getLogger(__name__)
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/FACTORS_training_disguised_combi... | 34.217391 | 149 | 0.743188 | import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
logger = logging.getLogger(__name__)
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/FACTORS_training_disguised_combined_full.csv.gz"
VALID_URL = "... | true | true |
f715aab0451804e3126d9a43d6e5f34e22e7a392 | 15,596 | py | Python | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | 5 | 2021-12-14T03:33:39.000Z | 2022-01-11T14:13:21.000Z | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | """
SQL composition utility module
"""
# Copyright (C) 2020-2021 The Psycopg Team
import codecs
import string
from abc import ABC, abstractmethod
from typing import Any, Iterator, List, Optional, Sequence, Union
from .pq import Escaping
from .abc import AdaptContext
from .adapt import Transformer, PyFormat
from ._en... | 33.757576 | 85 | 0.591883 |
import codecs
import string
from abc import ABC, abstractmethod
from typing import Any, Iterator, List, Optional, Sequence, Union
from .pq import Escaping
from .abc import AdaptContext
from .adapt import Transformer, PyFormat
from ._encodings import pgconn_encoding
def quote(obj: Any, context: Optional[AdaptConte... | true | true |
f715ab79d63a14aca43b177b0113ad356a236fd3 | 1,008 | py | Python | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class ToolStripItemAlignment(Enum,IComparable,IFormattable,IConvertible):
"""
Determines the alignment of a System.Windows.Forms.ToolStripItem in a System.Windows.Forms.ToolStrip.
enum ToolStripItemAlignment,values: Left (0),Right (1)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <=... | 29.647059 | 215 | 0.675595 | class ToolStripItemAlignment(Enum,IComparable,IFormattable,IConvertible):
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) i... | true | true |
f715ab87bac08f07d5539e7b64cc21481970b063 | 8,682 | py | Python | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | from __future__ import annotations
from anytree import NodeMixin
from datetime import datetime, timezone
from dotenv import load_dotenv
from os import environ
from os.path import join, dirname
from typing import Tuple, List, Any, Dict, Optional
import re
import requests
from rich.box import Box
__all__ = [
"get_d... | 27.738019 | 109 | 0.584543 | from __future__ import annotations
from anytree import NodeMixin
from datetime import datetime, timezone
from dotenv import load_dotenv
from os import environ
from os.path import join, dirname
from typing import Tuple, List, Any, Dict, Optional
import re
import requests
from rich.box import Box
__all__ = [
"get_d... | true | true |
f715ac6786b1c8d153bae843595f1b3b37a7b901 | 6,518 | py | Python | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 2 | 2019-07-14T23:16:09.000Z | 2019-10-26T10:54:38.000Z | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 5 | 2017-02-06T16:50:48.000Z | 2020-08-21T03:50:06.000Z | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 5 | 2016-05-03T16:41:14.000Z | 2022-01-14T22:22:58.000Z | #!/usr/bin/env python
""" """
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2009 Hendrix Demers"
__license__ = ""
# Standard library modules.
import logging
import os.path
# Third party modu... | 35.617486 | 109 | 0.596502 |
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2009 Hendrix Demers"
__license__ = ""
import logging
import os.path
from PIL import Image
import casinotools.fileformat.casino3.File as File
import casinotools.fileformat.cas... | true | true |
f715af0a24dd23852f403a9a2f9f37a1c461984d | 66 | py | Python | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | 1 | 2020-12-19T05:04:19.000Z | 2020-12-19T05:04:19.000Z | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | null | null | null | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | null | null | null | from . import config, storage
from .listener import TweetListener
| 22 | 35 | 0.818182 | from . import config, storage
from .listener import TweetListener
| true | true |
f715af426554e6845a9d59b633445b811a99ff66 | 1,074 | py | Python | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | 1 | 2021-05-14T15:21:42.000Z | 2021-05-14T15:21:42.000Z | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | 2 | 2021-05-13T10:26:36.000Z | 2021-05-13T19:30:25.000Z | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | null | null | null | from django.db import transaction
from rest_framework import generics, mixins
class BaseAPIView(generics.GenericAPIView,
mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.... | 31.588235 | 60 | 0.620112 | from django.db import transaction
from rest_framework import generics, mixins
class BaseAPIView(generics.GenericAPIView,
mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.... | true | true |
f715b0166e705758a0701b19f80e34986238aa34 | 4,522 | py | Python | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 4 | 2015-11-12T10:58:54.000Z | 2017-08-05T06:41:36.000Z | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 13 | 2018-07-11T10:45:30.000Z | 2018-08-18T00:43:30.000Z | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 5 | 2020-05-12T13:38:14.000Z | 2022-03-17T17:17:50.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 31.402778 | 79 | 0.627377 |
import unittest
import datetime
from airflow import DAG, configuration
from airflow.contrib.sensors.wasb_sensor import WasbBlobSensor
from airflow.contrib.sensors.wasb_sensor import WasbPrefixSensor
try:
from unittest import mock
except ImportError:
try:
import mock
except Imp... | true | true |
f715b08addca895d652922233042ac6fcca2b312 | 2,145 | py | Python | src/data/datasets/BAIR/BAIR.py | msc5/junior-iw | d356e015fcd3a3be638097a1acc02d5dea4751aa | [
"MIT"
] | null | null | null | src/data/datasets/BAIR/BAIR.py | msc5/junior-iw | d356e015fcd3a3be638097a1acc02d5dea4751aa | [
"MIT"
] | null | null | null | src/data/datasets/BAIR/BAIR.py | msc5/junior-iw | d356e015fcd3a3be638097a1acc02d5dea4751aa | [
"MIT"
] | null | null | null | import os
import io
import numpy as np
from PIL import Image
import torch
from torchvision.transforms import ToTensor
class BAIR (object):
"""Data Handler that loads robot pushing data."""
def __init__(self, data_root, train=True, seq_len=20, image_size=64):
self.root_dir = data_root
if tra... | 31.086957 | 73 | 0.577622 | import os
import io
import numpy as np
from PIL import Image
import torch
from torchvision.transforms import ToTensor
class BAIR (object):
def __init__(self, data_root, train=True, seq_len=20, image_size=64):
self.root_dir = data_root
if train:
self.data_dir = '%s/processed_data/tra... | true | true |
f715b222c54a26cf324ab888f732b9102ea604a6 | 20,214 | py | Python | tools/nni_cmd/config_schema.py | skyser2003/nni | b946888fadacdb761e4c3a79bd869284af1da3b3 | [
"MIT"
] | 1 | 2021-03-27T10:42:42.000Z | 2021-03-27T10:42:42.000Z | tools/nni_cmd/config_schema.py | lswzjuer/nni | e9cba778257804a2a1a6002687835233a779d7af | [
"MIT"
] | null | null | null | tools/nni_cmd/config_schema.py | lswzjuer/nni | e9cba778257804a2a1a6002687835233a779d7af | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from schema import Schema, And, Optional, Regex, Or
from .constants import SCHEMA_TYPE_ERROR, SCHEMA_RANGE_ERROR, SCHEMA_PATH_ERROR
def setType(key, valueType):
'''check key type'''
return And(valueType, error=SCHEMA_TYPE_ERRO... | 50.283582 | 137 | 0.597754 |
import os
from schema import Schema, And, Optional, Regex, Or
from .constants import SCHEMA_TYPE_ERROR, SCHEMA_RANGE_ERROR, SCHEMA_PATH_ERROR
def setType(key, valueType):
return And(valueType, error=SCHEMA_TYPE_ERROR % (key, valueType.__name__))
def setChoice(key, *args):
return And(lambda n: n in args, e... | true | true |
f715b265bb35aeb0434d5be280c4ded3ce5cd7ce | 4,313 | py | Python | src/camps/migrations/0001_initial.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/camps/migrations/0001_initial.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | src/camps/migrations/0001_initial.py | pwelzel/bornhack-website | af794e6a2fba06e09626259c7768feb30ff394be | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models, migrations
import uuid
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Ca... | 54.594937 | 210 | 0.592395 |
from django.db import models, migrations
import uuid
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Camp',
fields... | true | true |
f715b282dadb18b6d8c46e9e216062f47e9fa8c4 | 2,215 | py | Python | tests/models/symbol/ddc_log_data_returned_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/ddc_log_data_returned_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/ddc_log_data_returned_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 58.289474 | 845 | 0.776975 |
import unittest
from netapp.santricity.models.symbol.ddc_log_data_returned import DdcLogDataReturned
class DdcLogDataReturnedTest(unittest.TestCase):
def test_ddc_log_data_returned(self):
ddc_log_data_returned_obj = DdcLogDataReturned()
self.assertNotEqual(ddc_log_data_... | true | true |
f715b31b59adb44a6d805b23169c7a059551b417 | 4,970 | py | Python | ravager/bot/helpers/abort_upload_handler.py | CoolFool/Ravager | 3d647115689dc23a160255221aaa493f879406a5 | [
"MIT"
] | null | null | null | ravager/bot/helpers/abort_upload_handler.py | CoolFool/Ravager | 3d647115689dc23a160255221aaa493f879406a5 | [
"MIT"
] | 1 | 2022-03-15T06:55:48.000Z | 2022-03-15T15:38:20.000Z | ravager/bot/helpers/abort_upload_handler.py | CoolFool/Ravager | 3d647115689dc23a160255221aaa493f879406a5 | [
"MIT"
] | 2 | 2022-02-09T21:30:57.000Z | 2022-03-15T06:19:57.000Z | from ravager.services.google.helpers import uploader
from ravager.database.helpers.structs import OpsDataStruct
from ravager.database.tasks import Tasks
from ravager.celery_tasks.tasks import app
from ravager.services.aria.download import Download
from telegram.ext import CallbackQueryHandler
import logging
logger = l... | 46.886792 | 117 | 0.61328 | from ravager.services.google.helpers import uploader
from ravager.database.helpers.structs import OpsDataStruct
from ravager.database.tasks import Tasks
from ravager.celery_tasks.tasks import app
from ravager.services.aria.download import Download
from telegram.ext import CallbackQueryHandler
import logging
logger = l... | true | true |
f715b360e88e246929f30fa6b56a22448fc5ee17 | 228,126 | py | Python | cinder/volume/manager.py | sapcc/cinder | 9444ae7d2c7cfe2c277ff661ec9ef27a4f013f91 | [
"Apache-2.0"
] | null | null | null | cinder/volume/manager.py | sapcc/cinder | 9444ae7d2c7cfe2c277ff661ec9ef27a4f013f91 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/volume/manager.py | sapcc/cinder | 9444ae7d2c7cfe2c277ff661ec9ef27a4f013f91 | [
"Apache-2.0"
] | 3 | 2017-04-27T16:11:40.000Z | 2020-02-12T21:27:00.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 45.209275 | 79 | 0.554365 |
import requests
import time
from castellan import key_manager
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_serialization import jsonutils
from oslo_service import periodic_task
from oslo_utils import excutils
from oslo_utils import impor... | true | true |
f715b378abaeeb7ac3904a1e1b60d24e706d5389 | 1,803 | py | Python | tensorflow_federated/python/core/impl/executor_stacks/executor_stack_bindings_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | 1,918 | 2019-02-22T21:17:28.000Z | 2022-03-30T14:49:53.000Z | tensorflow_federated/python/core/impl/executor_stacks/executor_stack_bindings_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | 999 | 2019-02-22T21:47:44.000Z | 2022-03-31T11:06:42.000Z | tensorflow_federated/python/core/impl/executor_stacks/executor_stack_bindings_test.py | zhihansh/federated-oss | 38cfcb05702ff7297db76d3ccb5f5afef53ca09b | [
"Apache-2.0"
] | 498 | 2019-02-22T21:17:56.000Z | 2022-03-29T02:54:15.000Z | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.195652 | 89 | 0.749307 |
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
from pybind11_abseil import status as absl_status
from tensorflow_federated.python.core.impl.executor_stacks import executor_stack_bindings
from tensorflow_federated.python.core.impl.executors import executor_bind... | true | true |
f715b38795d175d33576ab05dea9a3fe41688f13 | 1,863 | py | Python | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null |
from detect import (detect_logos, detect_text)
import pandas as pd
import re
import os
#from __future__ import print_function
from google.cloud import vision
images_path = "C:\\Users\\heinz\\Yagora GmbH\\Ievgen Kyrda - Crawler\\images\\foodnewsgermany_images/"
file_names = os.listdir(os.path.dirname(images_path))
f... | 26.239437 | 102 | 0.688137 |
from detect import (detect_logos, detect_text)
import pandas as pd
import re
import os
from google.cloud import vision
images_path = "C:\\Users\\heinz\\Yagora GmbH\\Ievgen Kyrda - Crawler\\images\\foodnewsgermany_images/"
file_names = os.listdir(os.path.dirname(images_path))
file_paths = [images_path + f for f in ... | true | true |
f715b443834e4ea4db5d450ce663e81845d95977 | 749 | py | Python | Python/total-appeal-of-a-string.py | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | 4 | 2018-10-11T17:50:56.000Z | 2018-10-11T21:16:44.000Z | Python/total-appeal-of-a-string.py | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | null | null | null | Python/total-appeal-of-a-string.py | Priyansh2/LeetCode-Solutions | d613da1881ec2416ccbe15f20b8000e36ddf1291 | [
"MIT"
] | 4 | 2018-10-11T18:50:32.000Z | 2018-10-12T00:04:09.000Z | # Time: O(n)
# Space: O(26)
# combinatorics
class Solution(object):
def appealSum(self, s):
"""
:type s: str
:rtype: int
"""
result = curr = 0
lookup = [-1]*26
for i, c in enumerate(s):
result += (i-lookup[ord(c)-ord('a')])*(len(s)-i)
... | 20.805556 | 60 | 0.445928 |
class Solution(object):
def appealSum(self, s):
result = curr = 0
lookup = [-1]*26
for i, c in enumerate(s):
result += (i-lookup[ord(c)-ord('a')])*(len(s)-i)
lookup[ord(c)-ord('a')] = i
return result
class Solution2(object):
def appealSum(self, s)... | true | true |
f715b4574d66756d1158d3deb81d9fa1b677cc30 | 3,454 | py | Python | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/batch_tag_action_request_body.py | NQLoong/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/batch_tag_action_request_body.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/batch_tag_action_request_body.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class BatchTagActionRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and th... | 25.397059 | 76 | 0.54806 |
import pprint
import re
import six
class BatchTagActionRequestBody:
sensitive_list = []
openapi_types = {
'action': 'str',
'tags': 'list[BatchTagActionTagOption]'
}
attribute_map = {
'action': 'action',
'tags': 'tags'
}
def __init__(self, action=None... | true | true |
f715b4c57e072ac7d2f65d981630ad2bb277941f | 5,616 | py | Python | src/assisted_test_infra/test_infra/controllers/node_controllers/node_controller.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | null | null | null | src/assisted_test_infra/test_infra/controllers/node_controllers/node_controller.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | 248 | 2020-11-09T06:47:39.000Z | 2022-03-28T06:02:39.000Z | src/assisted_test_infra/test_infra/controllers/node_controllers/node_controller.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Any, Callable, List, Optional, SupportsAbs, Tuple, TypeVar
import libvirt
from assisted_test_infra.test_infra import BaseEntityConfig
from assisted_test_infra.test_infra.controllers.node_controllers.disk import Disk
from assisted_test_infra.test_infra.controllers... | 26.742857 | 116 | 0.667379 | from abc import ABC, abstractmethod
from typing import Any, Callable, List, Optional, SupportsAbs, Tuple, TypeVar
import libvirt
from assisted_test_infra.test_infra import BaseEntityConfig
from assisted_test_infra.test_infra.controllers.node_controllers.disk import Disk
from assisted_test_infra.test_infra.controllers... | true | true |
f715b57902684613288421b8c0d1be2ab344f1cf | 2,747 | py | Python | taxtea/checks.py | lowercase-app/django-taxtea | aa8184c1aceb67ecf34eda2e48184e810616f59f | [
"MIT"
] | 13 | 2020-07-20T17:35:32.000Z | 2021-09-25T02:11:44.000Z | taxtea/checks.py | lowercase-app/django-taxtea | aa8184c1aceb67ecf34eda2e48184e810616f59f | [
"MIT"
] | 51 | 2020-07-22T13:56:09.000Z | 2022-02-05T06:04:36.000Z | taxtea/checks.py | lowercase-app/django-taxtea | aa8184c1aceb67ecf34eda2e48184e810616f59f | [
"MIT"
] | null | null | null | from typing import List
from django.apps.config import AppConfig
from django.core.checks import CheckMessage, Critical, Tags, register
@register(Tags.compatibility)
def check_USPS_api_auth(app_configs: AppConfig = None, **kwargs) -> List[CheckMessage]:
"""
check_USPS_api_auth:
Checks if the user has ... | 30.186813 | 87 | 0.67419 | from typing import List
from django.apps.config import AppConfig
from django.core.checks import CheckMessage, Critical, Tags, register
@register(Tags.compatibility)
def check_USPS_api_auth(app_configs: AppConfig = None, **kwargs) -> List[CheckMessage]:
from . import settings as tax_settings
messages = []
... | true | true |
f715b7500a857c259eab2aab6854485671e9f369 | 6,405 | py | Python | lakshmi/cache.py | sarvjeets/lakshmi | 8cd6e47f23a61c5b8c967f9fdc756df296f1e0d5 | [
"MIT"
] | 59 | 2021-09-07T05:19:30.000Z | 2022-02-24T18:29:49.000Z | lakshmi/cache.py | sarvjeets/lakshmi | 8cd6e47f23a61c5b8c967f9fdc756df296f1e0d5 | [
"MIT"
] | 4 | 2021-08-01T18:32:51.000Z | 2022-02-26T19:14:37.000Z | lakshmi/cache.py | sarvjeets/lakshmi | 8cd6e47f23a61c5b8c967f9fdc756df296f1e0d5 | [
"MIT"
] | 3 | 2021-08-01T04:35:07.000Z | 2022-03-23T21:48:51.000Z | """
This class is used to cache return value of functions on disk for a specified
number of days. This is used by lakshmi.assets module to cache name/ asset
value (i.e the slow functions). For examples on how to use this class, please
see the tests (tests/test_cache.py file).
Currently, this module can only be used on... | 32.025 | 79 | 0.684465 |
import functools
import pickle
from abc import ABC, abstractmethod
from datetime import datetime
from hashlib import md5
from pathlib import Path
class Cacheable(ABC):
@abstractmethod
def cache_key(self):
pass
def get_file_age(file):
return (datetime.today()
- datetime.fromtimes... | true | true |
f715b7a5eadb8af7edda0af1e5732c76618605bb | 951 | py | Python | tests/test_basic.py | mustafamerttunali/Tensorflow-Training-GUI | ededb2dbfeefeac7ea6bf2986090ebcdf6905f45 | [
"MIT"
] | 84 | 2019-12-28T15:05:46.000Z | 2020-12-01T15:10:56.000Z | tests/test_basic.py | mustafakisacik/Deep-Learning-Training-GUI | 1992185fd18e768f30c5bb5edd08ea709be97b09 | [
"MIT"
] | 6 | 2019-12-28T02:18:08.000Z | 2020-11-13T17:40:14.000Z | tests/test_basic.py | mustafakisacik/Deep-Learning-Training-GUI | 1992185fd18e768f30c5bb5edd08ea709be97b09 | [
"MIT"
] | 23 | 2019-12-29T19:14:23.000Z | 2020-12-07T09:43:52.000Z | import os
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from multiprocessing import Process
def startTensorboard(logdir):
# Start tensorboard with system call
os.system("tensorboard --logdir {}".format(logdir))
def fitModel():
# Create your m... | 28.818182 | 60 | 0.684543 | import os
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from multiprocessing import Process
def startTensorboard(logdir):
os.system("tensorboard --logdir {}".format(logdir))
def fitModel():
model = Sequential()
model.add(Dense(32, a... | true | true |
f715b9d364ffce61b2e55ddeebf9ea8f7ff852a8 | 1,094 | py | Python | tests/contrib/hooks/test_nomad_hook.py | YotpoLtd/incubator-airflow | 86bd47db6084b23f4eb4b4c1dfc7f0293e4308e2 | [
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2021-07-27T15:47:56.000Z | 2021-07-27T15:47:56.000Z | tests/contrib/hooks/test_nomad_hook.py | YotpoLtd/incubator-airflow | 86bd47db6084b23f4eb4b4c1dfc7f0293e4308e2 | [
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | tests/contrib/hooks/test_nomad_hook.py | YotpoLtd/incubator-airflow | 86bd47db6084b23f4eb4b4c1dfc7f0293e4308e2 | [
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 30.388889 | 74 | 0.756856 |
import unittest
from mock import patch
from airflow import configuration
from airflow.contrib.hooks.nomad_hook import NomadHook
class TestNomadHook(unittest.TestCase):
def setUp(self):
configuration.load_test_config()
@patch("airflow.contrib.hooks.nomad_hook.NomadHook.get_nomad_clien... | true | true |
f715bb669761fdc7d43cef478f02a3c2769d3f57 | 1,243 | py | Python | scripts/suse/yum/plugins/yumnotify.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 2 | 2020-11-02T22:08:26.000Z | 2020-11-14T13:44:46.000Z | scripts/suse/yum/plugins/yumnotify.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 4 | 2021-02-06T14:30:48.000Z | 2021-12-13T20:50:10.000Z | scripts/suse/yum/plugins/yumnotify.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:32:02.000Z | 2020-11-06T11:01:18.000Z | # Copyright (c) 2016 SUSE Linux LLC
# All Rights Reserved.
#
# Author: Bo Maryniuk <bo@suse.de>
import hashlib
import os
from yum import config
from yum.plugins import TYPE_CORE
CK_PATH = "/var/cache/salt/minion/rpmdb.cookie"
RPM_PATH = "/var/lib/rpm/Packages"
requires_api_version = "2.5"
plugin_type = TYPE_CORE
... | 21.067797 | 87 | 0.618665 |
import hashlib
import os
from yum import config
from yum.plugins import TYPE_CORE
CK_PATH = "/var/cache/salt/minion/rpmdb.cookie"
RPM_PATH = "/var/lib/rpm/Packages"
requires_api_version = "2.5"
plugin_type = TYPE_CORE
def _get_mtime():
return os.path.exists(RPM_PATH) and int(os.path.getmtime(RPM_PATH)) or... | true | true |
f715bca80298b84ce5bd4435a0da66ffc75de251 | 19,652 | py | Python | Bloxorz.py | ilkercankaya/Bloxorz | 212e8f051329f4f7392e336b9a99d5c4ae78c019 | [
"MIT"
] | null | null | null | Bloxorz.py | ilkercankaya/Bloxorz | 212e8f051329f4f7392e336b9a99d5c4ae78c019 | [
"MIT"
] | null | null | null | Bloxorz.py | ilkercankaya/Bloxorz | 212e8f051329f4f7392e336b9a99d5c4ae78c019 | [
"MIT"
] | null | null | null | # 0 is for perpendicular mode
# 1 is for flat mode
# 0 is for X-Axis config
# 1 is for Y-Axis mode
from copy import deepcopy
class Block:
def __init__(self, givenboard, mode, config, positionfirstbox, positionsecondbox):
# Copy Board
self.board = givenboard
# Fill the Board with Block
... | 48.403941 | 112 | 0.520507 |
from copy import deepcopy
class Block:
def __init__(self, givenboard, mode, config, positionfirstbox, positionsecondbox):
self.board = givenboard
self.board.field[positionfirstbox[0]][positionfirstbox[1]] = 2
if positionsecondbox != []:
self.board.field[pos... | true | true |
f715bcdc38ebdc27ec473e15774bc7f195755daa | 5,704 | py | Python | asposewordscloud/models/bookmark_data.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | asposewordscloud/models/bookmark_data.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | asposewordscloud/models/bookmark_data.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="bookmark_data.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... | 32.409091 | 85 | 0.558555 |
import pprint
import re
import six
import json
class BookmarkData(object):
swagger_types = {
'name': 'str',
'text': 'str'
}
attribute_map = {
'name': 'Name',
'text': 'Text'
}
def __init__(self, name=None, text=None):
self._n... | true | true |
f715bcfb6bc96e73744dd0a50b070cfdd7c67ca2 | 1,316 | py | Python | torch_glow/tests/nodes/adaptive_avg_pool2d_test.py | YonginKwon/glow | 7d316d028e1792534416755bf80af422adccdaa9 | [
"Apache-2.0"
] | 2 | 2020-03-23T21:04:00.000Z | 2020-04-02T22:49:49.000Z | torch_glow/tests/nodes/adaptive_avg_pool2d_test.py | YonginKwon/glow | 7d316d028e1792534416755bf80af422adccdaa9 | [
"Apache-2.0"
] | 1 | 2020-01-06T09:14:32.000Z | 2020-01-06T09:14:32.000Z | torch_glow/tests/nodes/adaptive_avg_pool2d_test.py | YonginKwon/glow | 7d316d028e1792534416755bf80af422adccdaa9 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch.nn.functional as F
from tests.utils import jitVsGlow
import unittest
class TestAdaptiveAvgPool2d(unittest.TestCase):
def test_adaptive_avg_pool2d_basic(self):
"""Basic test of PyTorch adaptive_av... | 30.604651 | 82 | 0.668693 | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch.nn.functional as F
from tests.utils import jitVsGlow
import unittest
class TestAdaptiveAvgPool2d(unittest.TestCase):
def test_adaptive_avg_pool2d_basic(self):
def test_f(inputs):
ret... | true | true |
f715bdd5034a351c309d1a984393c7e6094f054e | 274 | py | Python | apigw/typo.py | theztd/flaskapp-prom | e1f5137c319175fe8fc1db0ede8eec020cd2f008 | [
"BSD-2-Clause"
] | 2 | 2021-02-27T21:08:00.000Z | 2021-05-12T13:55:38.000Z | apigw/typo.py | theztd/flaskapp-prom | e1f5137c319175fe8fc1db0ede8eec020cd2f008 | [
"BSD-2-Clause"
] | null | null | null | apigw/typo.py | theztd/flaskapp-prom | e1f5137c319175fe8fc1db0ede8eec020cd2f008 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
def ret_string(name: str) -> str:
print(type(name))
return f"Hi {name}"
for n in ["Karel", "Pepa", 18, "Lucie"]:
try:
print(type(n))
print(ret_string(n))
except TypeError as err:
print(n)
print(err)
| 17.125 | 40 | 0.547445 |
def ret_string(name: str) -> str:
print(type(name))
return f"Hi {name}"
for n in ["Karel", "Pepa", 18, "Lucie"]:
try:
print(type(n))
print(ret_string(n))
except TypeError as err:
print(n)
print(err)
| true | true |
f715bdeeabab1bf9416cdf699d275a46c2adb6d6 | 270 | py | Python | wafw00f/plugins/knownsec.py | aqyoung/scan-wafw00f | a95a94253f138d5ef791232ef4d8371de41622b6 | [
"BSD-3-Clause"
] | 1 | 2019-08-01T11:19:55.000Z | 2019-08-01T11:19:55.000Z | wafw00f/plugins/knownsec.py | aqyoung/scan-wafw00f | a95a94253f138d5ef791232ef4d8371de41622b6 | [
"BSD-3-Clause"
] | null | null | null | wafw00f/plugins/knownsec.py | aqyoung/scan-wafw00f | a95a94253f138d5ef791232ef4d8371de41622b6 | [
"BSD-3-Clause"
] | 2 | 2017-12-27T15:56:15.000Z | 2017-12-27T20:03:09.000Z | #!/usr/bin/env python
NAME = 'KS-WAF (KnownSec)'
def is_waf(self):
for attack in self.attacks:
r = attack(self)
if r is None:
return
_, page = r
if b'/ks-waf-error.png' in page:
return True
return False | 18 | 40 | 0.525926 |
NAME = 'KS-WAF (KnownSec)'
def is_waf(self):
for attack in self.attacks:
r = attack(self)
if r is None:
return
_, page = r
if b'/ks-waf-error.png' in page:
return True
return False | true | true |
f715be36cb847900ba0b72075d63650894204e29 | 16,357 | py | Python | google/cloud/bigquery_storage_v1beta2/services/big_query_read/transports/grpc_asyncio.py | googleapis/python-bigquery-storage | acc92249013f1b31fdac2aa4bf5a6864730d7422 | [
"Apache-2.0"
] | 44 | 2020-02-12T21:28:37.000Z | 2022-03-31T06:16:30.000Z | google/cloud/bigquery_storage_v1beta2/services/big_query_read/transports/grpc_asyncio.py | googleapis/python-bigquery-storage | acc92249013f1b31fdac2aa4bf5a6864730d7422 | [
"Apache-2.0"
] | 178 | 2020-02-05T10:49:45.000Z | 2022-03-31T01:48:44.000Z | google/cloud/bigquery_storage_v1beta2/services/big_query_read/transports/grpc_asyncio.py | googleapis/python-bigquery-storage | acc92249013f1b31fdac2aa4bf5a6864730d7422 | [
"Apache-2.0"
] | 23 | 2020-02-05T23:12:15.000Z | 2022-02-24T08:33:14.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 45.310249 | 88 | 0.645656 |
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials
from google.auth.transport.grpc import SslCredentials
import pa... | true | true |
f715bec4b32bc353255f534021aae397a4a5e309 | 5,398 | py | Python | repair/evaluate.py | h4iku/repairSStuBs | 0caa6269801d13f4743e6b2c8d34c01057f3b4b7 | [
"MIT"
] | 2 | 2021-07-16T04:30:10.000Z | 2022-01-05T01:33:42.000Z | repair/evaluate.py | h4iku/repairSStuBs | 0caa6269801d13f4743e6b2c8d34c01057f3b4b7 | [
"MIT"
] | 1 | 2021-06-17T06:57:49.000Z | 2021-06-18T00:13:14.000Z | repair/evaluate.py | h4iku/repairSStuBs | 0caa6269801d13f4743e6b2c8d34c01057f3b4b7 | [
"MIT"
] | 1 | 2021-05-27T05:50:17.000Z | 2021-05-27T05:50:17.000Z | import csv
import difflib
import shutil
from collections import defaultdict
from statistics import mean
from pytablewriter import MarkdownTableWriter
from tqdm import tqdm
from utils.config import CORRECT_PATCHES, INPUT, REPAIR_OUTPUT, REPAIR_RESULT
class Result:
def __init__(self, buggy_file_line_dir, comparis... | 35.051948 | 80 | 0.626343 | import csv
import difflib
import shutil
from collections import defaultdict
from statistics import mean
from pytablewriter import MarkdownTableWriter
from tqdm import tqdm
from utils.config import CORRECT_PATCHES, INPUT, REPAIR_OUTPUT, REPAIR_RESULT
class Result:
def __init__(self, buggy_file_line_dir, comparis... | true | true |
f715bf4feddced17be81d083c4130de44ac9c701 | 1,692 | py | Python | multiple-images/images/migrations/0001_initial.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | multiple-images/images/migrations/0001_initial.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | 13 | 2020-02-12T00:14:20.000Z | 2022-02-10T08:46:42.000Z | multiple-images/images/migrations/0001_initial.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-13 17:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Description',
fields=[
... | 36 | 144 | 0.536643 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Description',
fields=[
('id', models.AutoField(auto_creat... | true | true |
f715bf76749dbe6664dac3361f0fd6ab0369fb12 | 1,123 | py | Python | websauna/tests/core/test_views.py | stevepiercy/websauna | 2886b86f7920d75900c634958779d61aa73f011b | [
"CNRI-Python"
] | 286 | 2016-01-17T05:44:02.000Z | 2022-02-07T20:28:49.000Z | websauna/tests/core/test_views.py | stevepiercy/websauna | 2886b86f7920d75900c634958779d61aa73f011b | [
"CNRI-Python"
] | 203 | 2016-03-15T02:00:53.000Z | 2021-09-27T10:48:49.000Z | websauna/tests/core/test_views.py | ooduor/websauna | 2e78cd87eda305fbbb1080d386b8cf96537360e5 | [
"CNRI-Python"
] | 71 | 2016-01-17T11:04:26.000Z | 2021-08-24T08:04:31.000Z | # Standard Library
import os
import pytest
# Websauna
from websauna.system import Initializer
from websauna.system.core.route import add_template_only_view
from websauna.tests.fixtures import get_app
from websauna.tests.webserver import customized_web_server
HERE = os.path.abspath(os.path.dirname(__file__))
def e... | 26.738095 | 70 | 0.743544 |
import os
import pytest
from websauna.system import Initializer
from websauna.system.core.route import add_template_only_view
from websauna.tests.fixtures import get_app
from websauna.tests.webserver import customized_web_server
HERE = os.path.abspath(os.path.dirname(__file__))
def extra_init(init: Initializer)... | true | true |
f715c03152794cffe7e9e530cbda79e5552a407d | 591 | bzl | Python | Examples/ReactNativeKakaoExample/android/app/build_defs.bzl | namdq97/react-native-kakao-login | 603d4f75c912ecdefcfbc2bb7ace02b530a06083 | [
"MIT"
] | 46 | 2017-05-14T13:01:24.000Z | 2022-01-19T00:35:23.000Z | Examples/ReactNativeKakaoExample/android/app/build_defs.bzl | namdq97/react-native-kakao-login | 603d4f75c912ecdefcfbc2bb7ace02b530a06083 | [
"MIT"
] | 12 | 2018-01-12T08:00:27.000Z | 2019-08-11T03:07:47.000Z | Examples/ReactNativeKakaoExample/android/app/build_defs.bzl | namdq97/react-native-kakao-login | 603d4f75c912ecdefcfbc2bb7ace02b530a06083 | [
"MIT"
] | 16 | 2017-05-14T13:29:53.000Z | 2020-11-26T04:01:46.000Z | """Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
... | 34.764706 | 81 | 0.57868 | def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
def create_jar_targets(jarfiles):
for jarfi... | true | true |
f715c0b803bbc30d25555211d20acb2cc3914485 | 21 | py | Python | prm/__init__.py | fz420/prm | 19d8b27a679d6f9e669e019a563c3433025ba0c6 | [
"MIT"
] | null | null | null | prm/__init__.py | fz420/prm | 19d8b27a679d6f9e669e019a563c3433025ba0c6 | [
"MIT"
] | 3 | 2021-03-05T06:42:18.000Z | 2021-04-30T03:34:30.000Z | prm/__init__.py | fz420/prm | 19d8b27a679d6f9e669e019a563c3433025ba0c6 | [
"MIT"
] | 2 | 2021-04-23T03:19:57.000Z | 2021-04-23T03:49:55.000Z | from .prm import main | 21 | 21 | 0.809524 | from .prm import main | true | true |
f715c0cdf7d479cb571c7245fd89a407280d6b17 | 5,913 | py | Python | src/visualisation/arrow.py | sdat2/seager19 | 9c3acbc5332da787de1eda2600a82490ff20fa11 | [
"MIT"
] | 5 | 2021-04-08T19:03:52.000Z | 2021-12-17T14:22:49.000Z | src/visualisation/arrow.py | sdat2/seager19 | 9c3acbc5332da787de1eda2600a82490ff20fa11 | [
"MIT"
] | 25 | 2021-04-08T13:53:11.000Z | 2022-03-17T19:45:15.000Z | src/visualisation/arrow.py | sdat2/seager19 | 9c3acbc5332da787de1eda2600a82490ff20fa11 | [
"MIT"
] | null | null | null | """Arrow plots for mechanism."""
import os
from src.plot_utils import ps_defaults
from src.constants import FIGURE_PATH
from typing import Optional
import matplotlib.pyplot as plt
def plot_arrow_plot(save_path: Optional[str] = None, show_plots: bool = False) -> None:
"""
Plot the arrow plot to show that I hav... | 25.161702 | 88 | 0.498393 | import os
from src.plot_utils import ps_defaults
from src.constants import FIGURE_PATH
from typing import Optional
import matplotlib.pyplot as plt
def plot_arrow_plot(save_path: Optional[str] = None, show_plots: bool = False) -> None:
ps_defaults(use_tex=False)
color_d = {
"EEEE": "blue",
"EE... | true | true |
f715c25e8a6baf9dd30e5de343c4575f046db6a9 | 11,450 | py | Python | elite/route.py | mEDI-S/mEDI_s-Elite-Tools | c6927c79358a3781bdf9da0db82c8c7d46f70dc6 | [
"BSD-3-Clause"
] | 15 | 2015-08-30T01:53:10.000Z | 2021-02-19T21:35:07.000Z | elite/route.py | mEDI-S/mEDI_s-Elite-Tools | c6927c79358a3781bdf9da0db82c8c7d46f70dc6 | [
"BSD-3-Clause"
] | 2 | 2018-02-21T22:13:37.000Z | 2021-03-06T16:48:26.000Z | elite/route.py | mEDI-S/mEDI_s-Elite-Tools | c6927c79358a3781bdf9da0db82c8c7d46f70dc6 | [
"BSD-3-Clause"
] | 7 | 2015-11-22T15:25:07.000Z | 2020-05-23T01:29:40.000Z | # -*- coding: UTF8
'''
Created on 13.07.2015
@author: mEDI
'''
from elite.system import system as elitesystem
#from elite.rares import rares as eliterares
# from elite.route import route as eliteroute
class route(object):
'''
classdocs
'''
#__slots__ = ["bla"]
#bla =1
... | 38.294314 | 230 | 0.585415 |
from elite.system import system as elitesystem
class route(object):
maxHops = None
maxJumpDistance = None
maxDeep = None
systemID = None
_before = None
m = None
possibleSystems = []
_raresInSystem = None
_availableSystemList = None
_sellDon... | true | true |
f715c277513bc3a3aa82c20df1b2e8276d462a27 | 9,895 | py | Python | pcdsdevices/tests/test_ccm.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-06-17T20:08:54.000Z | 2022-01-11T17:55:21.000Z | pcdsdevices/tests/test_ccm.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | 757 | 2017-12-21T23:16:41.000Z | 2022-03-31T22:56:06.000Z | pcdsdevices/tests/test_ccm.py | vespos/pcdsdevices | 7c4728df62ea58b6491d1cb36bb39d27d6dd9fca | [
"BSD-3-Clause-LBNL"
] | 38 | 2018-01-26T00:01:35.000Z | 2022-02-17T00:48:55.000Z | import logging
import time
import numpy as np
import pytest
from ophyd.sim import fake_device_cache, make_fake_device
from .. import ccm
from ..sim import FastMotor
logger = logging.getLogger(__name__)
SAMPLE_ALIO = 4.575 # Current value as of writing this file
SAMPLE_THETA = 1.2 # Modest angle
SAMPLE_WAVELENGTH... | 33.316498 | 78 | 0.700455 | import logging
import time
import numpy as np
import pytest
from ophyd.sim import fake_device_cache, make_fake_device
from .. import ccm
from ..sim import FastMotor
logger = logging.getLogger(__name__)
SAMPLE_ALIO = 4.575
SAMPLE_THETA = 1.2
SAMPLE_WAVELENGTH = 1.5
def test_theta_alio_inversion():
logg... | true | true |
f715c27add3916da3a4ba06ed5e3227bf392db8f | 4,303 | py | Python | spectree/models.py | loonateam/spectree | 71b2d34993e01b36a8de18c2a3d6856d0c9e45c3 | [
"Apache-2.0"
] | 183 | 2019-12-29T00:37:09.000Z | 2022-03-15T20:37:53.000Z | spectree/models.py | 0b01001001/spectree | 35f17fe9694031a335223111d7fb38175d7e6e25 | [
"Apache-2.0"
] | 102 | 2019-12-13T09:10:53.000Z | 2022-03-15T06:21:29.000Z | spectree/models.py | loonateam/spectree | 71b2d34993e01b36a8de18c2a3d6856d0c9e45c3 | [
"Apache-2.0"
] | 51 | 2020-01-06T21:06:07.000Z | 2022-03-19T16:10:58.000Z | import re
from enum import Enum
from typing import Any, Dict, Sequence
from pydantic import BaseModel, Field, root_validator, validator
# OpenAPI names validation regexp
OpenAPI_NAME_RE = re.compile(r"^[A-Za-z0-9-._]+")
class ExternalDocs(BaseModel):
description: str = ""
url: str
class Tag(BaseModel):
... | 25.163743 | 97 | 0.614455 | import re
from enum import Enum
from typing import Any, Dict, Sequence
from pydantic import BaseModel, Field, root_validator, validator
OpenAPI_NAME_RE = re.compile(r"^[A-Za-z0-9-._]+")
class ExternalDocs(BaseModel):
description: str = ""
url: str
class Tag(BaseModel):
name: str
description: str... | true | true |
f715c2f9b4de2c046a801fa47e5dbf73f975953d | 820 | py | Python | phone_iso3166/network.py | foxkirov/phone-iso3166 | 8419091e906c439f9362690d7d2d02186098e5c4 | [
"MIT"
] | 19 | 2017-03-28T10:35:22.000Z | 2022-03-14T04:39:03.000Z | phone_iso3166/network.py | foxkirov/phone-iso3166 | 8419091e906c439f9362690d7d2d02186098e5c4 | [
"MIT"
] | 17 | 2016-11-11T11:50:57.000Z | 2021-06-22T09:32:17.000Z | phone_iso3166/network.py | foxkirov/phone-iso3166 | 8419091e906c439f9362690d7d2d02186098e5c4 | [
"MIT"
] | 5 | 2015-09-28T18:25:38.000Z | 2021-07-05T11:57:58.000Z | from .e212_names import operators, countries
from .errors import InvalidNetwork, InvalidCountry
def network(mcc, mnc):
'''
Returns a tuple (country, network_name), with country specified as
ISO-3166-1 alpha-2 code.
'''
mcc = int(mcc)
mnc = int(mnc)
try:
return operators[mcc][mnc]
... | 28.275862 | 75 | 0.636585 | from .e212_names import operators, countries
from .errors import InvalidNetwork, InvalidCountry
def network(mcc, mnc):
mcc = int(mcc)
mnc = int(mnc)
try:
return operators[mcc][mnc]
except:
raise InvalidNetwork('Invalid MCC {} MNC {}'.format(mcc, mnc))
def country_networks(country):
... | true | true |
f715c364022f5d19e2b6087341499850fd3d9b4c | 501 | py | Python | polidoro_terminal/__init__.py | heitorpolidoro/py-terminal | 3ef04d12aa48ef6d214598df34ddf932518f4614 | [
"MIT"
] | null | null | null | polidoro_terminal/__init__.py | heitorpolidoro/py-terminal | 3ef04d12aa48ef6d214598df34ddf932518f4614 | [
"MIT"
] | null | null | null | polidoro_terminal/__init__.py | heitorpolidoro/py-terminal | 3ef04d12aa48ef6d214598df34ddf932518f4614 | [
"MIT"
] | null | null | null | from polidoro_terminal.size import size, columns, rows
from polidoro_terminal.manipulation import erase_lines, up_lines, clear_to_end_of_line
from polidoro_terminal import cursor
from polidoro_terminal.color import Color
from polidoro_terminal.format import Format
from polidoro_terminal.question import question
NAME =... | 38.538462 | 107 | 0.784431 | from polidoro_terminal.size import size, columns, rows
from polidoro_terminal.manipulation import erase_lines, up_lines, clear_to_end_of_line
from polidoro_terminal import cursor
from polidoro_terminal.color import Color
from polidoro_terminal.format import Format
from polidoro_terminal.question import question
NAME =... | true | true |
f715c430f48dcf933c9fde5179a7cfbfd6339883 | 8,381 | py | Python | hubspot/crm/deals/models/batch_response_simple_public_object.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/deals/models/batch_response_simple_public_object.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | hubspot/crm/deals/models/batch_response_simple_public_object.py | cclauss/hubspot-api-python | 7c60c0f572b98c73e1f1816bf5981396a42735f6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Deals
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubspot... | 32.111111 | 162 | 0.624866 |
import pprint
import re
import six
from hubspot.crm.deals.configuration import Configuration
class BatchResponseSimplePublicObject(object):
openapi_types = {
'status': 'str',
'results': 'list[SimplePublicObject]',
'requested_at': 'datetime',
'started_at': 'datetime',
... | true | true |
f715c44f3f9b2781b37fa1bf5d47e32a81a7c1be | 8,332 | py | Python | SimPEG/electromagnetics/analytics/FDEM.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | 1 | 2022-02-18T16:31:27.000Z | 2022-02-18T16:31:27.000Z | SimPEG/electromagnetics/analytics/FDEM.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | null | null | null | SimPEG/electromagnetics/analytics/FDEM.py | ElliotCheung/simpeg | ce5bde154179ca63798a62a12787a7ec3535472c | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erf
from SimPEG import utils
import warnings
def hzAnalyticDipoleF(r, freq, sigma, secondary=True, mu=mu_0):
"""
The analytical expression is given in Equation 4.56 in Ward and Hohmann,... | 30.079422 | 84 | 0.491959 | from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erf
from SimPEG import utils
import warnings
def hzAnalyticDipoleF(r, freq, sigma, secondary=True, mu=mu_0):
r = np.abs(r)
k = np.sqrt(-1j * 2.0 * np.pi * freq * mu * sigma)
m = 1
... | true | true |
f715c4faf3c9fe1f421e85c3edcd776dc7e1569d | 5,188 | py | Python | test/functional/nulldummy.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | 5 | 2018-07-21T15:58:30.000Z | 2019-04-25T01:45:36.000Z | test/functional/nulldummy.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | null | null | null | test/functional/nulldummy.py | chx381/platopia | 563c616db768f813aa4482d39d8ed1d8aacaad4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from t... | 40.53125 | 125 | 0.644372 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block
from test_framework.script import CScript
from io import BytesIO
import time
... | true | true |
f715c501c1f5d7c019455fce3fc6397536a093ce | 288 | py | Python | universal/items.py | universalscraper/universal-spider | 0b6d82ee0c749cf32dcf501e6d84f518ee2e8437 | [
"MIT"
] | 2 | 2017-01-14T20:09:24.000Z | 2019-09-23T09:26:23.000Z | universal/items.py | scraperize/universal-spider | 0b6d82ee0c749cf32dcf501e6d84f518ee2e8437 | [
"MIT"
] | null | null | null | universal/items.py | scraperize/universal-spider | 0b6d82ee0c749cf32dcf501e6d84f518ee2e8437 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class UniversalItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| 19.2 | 51 | 0.6875 |
import scrapy
class UniversalItem(scrapy.Item):
pass
| true | true |
f715c602904311d44b8bf950698fcd77ad53a6a8 | 3,800 | py | Python | img2pose/utils/renderer.py | jiacheng1gujiaxin/poseface | 316924e224477f881240712a13a925bdd27adf4c | [
"MIT"
] | null | null | null | img2pose/utils/renderer.py | jiacheng1gujiaxin/poseface | 316924e224477f881240712a13a925bdd27adf4c | [
"MIT"
] | null | null | null | img2pose/utils/renderer.py | jiacheng1gujiaxin/poseface | 316924e224477f881240712a13a925bdd27adf4c | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from Sim3DR import RenderPipeline
from .pose_operations import plot_3d_landmark
def _to_ctype(arr):
if not arr.flags.c_contiguous:
return arr.copy(order="C")
return arr
def get_colors(img, ver):
h, w, _ = img.shape
ver[0, :] = np.minimum(np.maximum(ver[0, :], 0... | 31.666667 | 81 | 0.517105 | import cv2
import numpy as np
from Sim3DR import RenderPipeline
from .pose_operations import plot_3d_landmark
def _to_ctype(arr):
if not arr.flags.c_contiguous:
return arr.copy(order="C")
return arr
def get_colors(img, ver):
h, w, _ = img.shape
ver[0, :] = np.minimum(np.maximum(ver[0, :], 0... | true | true |
f715c633d888342e2bcb33e9b3f302a45f208031 | 6,067 | py | Python | servers/Thot/schema.py | DiegoCorrea/bottleOfMessages | 1281d3f82ce4d44a31e426aa8862c3c9b294cf03 | [
"MIT"
] | null | null | null | servers/Thot/schema.py | DiegoCorrea/bottleOfMessages | 1281d3f82ce4d44a31e426aa8862c3c9b294cf03 | [
"MIT"
] | null | null | null | servers/Thot/schema.py | DiegoCorrea/bottleOfMessages | 1281d3f82ce4d44a31e426aa8862c3c9b294cf03 | [
"MIT"
] | null | null | null | import sqlite3
import sys
import os
import inspect
from time import gmtime, strftime
from config.server import APP_DB_PATH, SERVER_DB_PATH, WHO_AM_I
sys.path.append('..')
# conectando...
conn = sqlite3.connect(
os.path.dirname(
os.path.abspath(
inspect.getfile(
inspect.currentf... | 23.885827 | 73 | 0.606725 | import sqlite3
import sys
import os
import inspect
from time import gmtime, strftime
from config.server import APP_DB_PATH, SERVER_DB_PATH, WHO_AM_I
sys.path.append('..')
conn = sqlite3.connect(
os.path.dirname(
os.path.abspath(
inspect.getfile(
inspect.currentframe()
... | true | true |
f715c70e4981ec385e1f2070cf75f75007655155 | 293 | py | Python | sololearn/NewDriverLicense/DL.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 3 | 2020-01-08T18:33:11.000Z | 2022-02-08T00:38:26.000Z | sololearn/NewDriverLicense/DL.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | null | null | null | sololearn/NewDriverLicense/DL.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 4 | 2020-08-08T22:02:23.000Z | 2022-02-07T17:40:15.000Z | #!/usr/bin/python
name = input()
num_agents = int(input())
drivers = input().split()
drivers.append(name)
drivers.sort()
index = drivers.index(name) + 1
if num_agents > index:
num_agents = index
rem = index % num_agents
div = index // num_agents
time = (rem + div) * 20
print(time) | 14.65 | 31 | 0.665529 |
name = input()
num_agents = int(input())
drivers = input().split()
drivers.append(name)
drivers.sort()
index = drivers.index(name) + 1
if num_agents > index:
num_agents = index
rem = index % num_agents
div = index // num_agents
time = (rem + div) * 20
print(time) | true | true |
f715c76c0e7bc0f285f65f27afbb7bee42da3afb | 805 | py | Python | server/urls.py | w769076810/myhome | 38e39b15c84f8c60fe3f02b46053a8971e081b9a | [
"MIT"
] | null | null | null | server/urls.py | w769076810/myhome | 38e39b15c84f8c60fe3f02b46053a8971e081b9a | [
"MIT"
] | null | null | null | server/urls.py | w769076810/myhome | 38e39b15c84f8c60fe3f02b46053a8971e081b9a | [
"MIT"
] | null | null | null | """server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 33.541667 | 77 | 0.70559 | from django.contrib import admin
from django.urls import path
from server import views
urlpatterns = [
path('test/', views.test)
]
| true | true |
f715c84088f7c8d2c89e008f545880f78639ed19 | 17,970 | py | Python | ansible/lib/ansible/modules/extras/storage/netapp/netapp_e_volume_copy.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/extras/storage/netapp/netapp_e_volume_copy.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/extras/storage/netapp/netapp_e_volume_copy.py | kiv-box/redis | 966a0c3f0a51282cd173b42a6e249d23f4e89dec | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | 40.840909 | 145 | 0.617641 |
DOCUMENTATION = """
---
module: netapp_e_volume_copy
short_description: Create volume copy pairs
description:
- Create and delete snapshots images on volume groups for NetApp E-series storage arrays.
version_added: '2.2'
author: Kevin Hulquest (@hulquest)
options:
api_username:
requir... | true | true |
f715ca8ab55b1a3d741b6e97e2473b7911154537 | 708 | py | Python | scripts/basic_support/robot_patrol_test.py | liminglong/micros_mars_task_alloc | 9b216e5494dbff6abd7b4c74eb72fc35eb392ca3 | [
"BSD-3-Clause"
] | 4 | 2016-06-15T02:44:43.000Z | 2021-12-20T15:43:32.000Z | scripts/basic_support/robot_patrol_test.py | liminglong/micros_mars_task_alloc | 9b216e5494dbff6abd7b4c74eb72fc35eb392ca3 | [
"BSD-3-Clause"
] | null | null | null | scripts/basic_support/robot_patrol_test.py | liminglong/micros_mars_task_alloc | 9b216e5494dbff6abd7b4c74eb72fc35eb392ca3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
__author__ = 'Minglong Li'
#import sys
#sys.path.append("~/catkin_ws/src/multi_robot_patrol/scripts/basic_support")
from robot_patrol_area_0 import RobotPatrolArea0
from robot_patrol_area_1 import RobotPatrolArea1
from robot_patrol_area_2 import RobotPatrolArea2
from motivational_behavior impor... | 28.32 | 85 | 0.80226 |
__author__ = 'Minglong Li'
from robot_patrol_area_0 import RobotPatrolArea0
from robot_patrol_area_1 import RobotPatrolArea1
from robot_patrol_area_2 import RobotPatrolArea2
from motivational_behavior import MotivationalBehavior
from switch import Switch
from std_msgs.msg import Bool
ob2 = RobotPatrolArea1()
ob... | true | true |
f715cb6225840f9ec494e8f8b22c82e88df7a2f3 | 45,794 | py | Python | flair.py | MustafaElshani/flair | ea058f3cc056e92b6f8a9ec7f7790dd6bed5766c | [
"BSD-3-Clause"
] | null | null | null | flair.py | MustafaElshani/flair | ea058f3cc056e92b6f8a9ec7f7790dd6bed5766c | [
"BSD-3-Clause"
] | null | null | null | flair.py | MustafaElshani/flair | ea058f3cc056e92b6f8a9ec7f7790dd6bed5766c | [
"BSD-3-Clause"
] | null | null | null | """ ADT, CMS """
import sys, argparse, subprocess, os, tempfile, glob
def align():
parser = argparse.ArgumentParser(description='flair-align parse options', \
usage='python flair.py align -g genome.fa -r <reads.fq>|<reads.fa> [options]')
parser.add_argument('align')
required = parser.add_argument_group('required... | 50.769401 | 129 | 0.694414 |
import sys, argparse, subprocess, os, tempfile, glob
def align():
parser = argparse.ArgumentParser(description='flair-align parse options', \
usage='python flair.py align -g genome.fa -r <reads.fq>|<reads.fa> [options]')
parser.add_argument('align')
required = parser.add_argument_group('required named arguments'... | true | true |
f715cce6602d941edd23731c966b3365ce9f1f13 | 1,536 | py | Python | polling_stations/apps/data_collection/management/commands/import_hertsmere.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_hertsmere.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | polling_stations/apps/data_collection/management/commands/import_hertsmere.py | chris48s/UK-Polling-Stations | 4742b527dae94f0276d35c80460837be743b7d17 | [
"BSD-3-Clause"
] | null | null | null | from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
council_id = 'E07000098'
srid = 27700
districts_srid = 27700
districts_name = 'PollingDistricts'
stations_name = 'PollingStations.shp'
elections = [
'l... | 34.133333 | 83 | 0.570313 | from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
council_id = 'E07000098'
srid = 27700
districts_srid = 27700
districts_name = 'PollingDistricts'
stations_name = 'PollingStations.shp'
elections = [
'l... | true | true |
f715cd43b332d5cf3dd6ecd996c97808734feaac | 1,497 | py | Python | superset/db_engine_specs/gsheets.py | ayuanty/superset | 132a8ef2cb55fa6692ea31d5c278f102d6c2886b | [
"Apache-2.0"
] | 1 | 2022-01-03T08:36:11.000Z | 2022-01-03T08:36:11.000Z | superset/db_engine_specs/gsheets.py | ayuanty/superset | 132a8ef2cb55fa6692ea31d5c278f102d6c2886b | [
"Apache-2.0"
] | 63 | 2021-06-12T18:25:14.000Z | 2022-03-21T07:57:02.000Z | superset/db_engine_specs/gsheets.py | ayuanty/superset | 132a8ef2cb55fa6692ea31d5c278f102d6c2886b | [
"Apache-2.0"
] | 1 | 2021-10-01T20:16:18.000Z | 2021-10-01T20:16:18.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.512195 | 70 | 0.741483 |
from typing import Optional
from sqlalchemy.engine.url import URL
from superset import security_manager
from superset.db_engine_specs.sqlite import SqliteEngineSpec
class GSheetsEngineSpec(SqliteEngineSpec):
engine = "gsheets"
engine_name = "Google Sheets"
allows_joins = False
allow... | true | true |
f715cd46be73951aea27a4ea4d8cd743000fd4dd | 1,164 | py | Python | test/functional/p2p_mempool.py | Pirontechv/Bitchain | 7ca7b6a8090f221d6982b09891c19ca5b7ace1d0 | [
"MIT"
] | 1 | 2020-03-13T14:59:52.000Z | 2020-03-13T14:59:52.000Z | test/functional/p2p_mempool.py | Pirontechv/Bitchain | 7ca7b6a8090f221d6982b09891c19ca5b7ace1d0 | [
"MIT"
] | null | null | null | test/functional/p2p_mempool.py | Pirontechv/Bitchain | 7ca7b6a8090f221d6982b09891c19ca5b7ace1d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p mempool message.
Test that nodes are disconnected if they send mempool messages when bloom
fi... | 32.333333 | 73 | 0.717354 |
from test_framework.mininode import *
from test_framework.test_framework import BitchainTestFramework
from test_framework.util import *
class P2PMempoolTests(BitchainTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-peerbl... | true | true |
f715ce83ac789168b60816ea12ee97e12d21dee1 | 5,162 | py | Python | tinyquery/repeated_util.py | graingert/tinyquery | f26940a2ad240911e278ef7c82e3f14e0f4c5e4e | [
"MIT"
] | 104 | 2015-02-21T22:54:15.000Z | 2022-03-21T11:08:02.000Z | tinyquery/repeated_util.py | graingert/tinyquery | f26940a2ad240911e278ef7c82e3f14e0f4c5e4e | [
"MIT"
] | 14 | 2018-01-30T16:32:09.000Z | 2022-03-02T12:57:11.000Z | tinyquery/repeated_util.py | graingert/tinyquery | f26940a2ad240911e278ef7c82e3f14e0f4c5e4e | [
"MIT"
] | 28 | 2015-09-16T22:42:44.000Z | 2022-01-15T11:51:45.000Z | """Helper functions for dealing with repeated fields.
It comes up in a few places that we need to flatten or unflatten repeated
columns when using them in conjunction with other repeated or scalar fields.
These functions allow us to flatten into non-repeated columns to apply various
operations and then unflatten back ... | 38.522388 | 79 | 0.678419 | from __future__ import absolute_import
from tinyquery import tq_modes
def rebuild_column_values(repetitions, values, result):
if len(repetitions) == 0:
return result
curr_repetition = repetitions[0]
curr_values = normalize_repeated_null(values[:max(curr_repetition, 1)])
return... | true | true |
f715ceb943279ec375261a9adc1d7aa35db8622f | 12,515 | py | Python | imputena/simple_imputation/linear_regression.py | macarro/imputena | 3a94ae1419a2af0d9707b20546ee078929ce99e8 | [
"MIT"
] | 6 | 2020-04-27T21:21:47.000Z | 2022-03-30T03:02:54.000Z | imputena/simple_imputation/linear_regression.py | macarro/imputena | 3a94ae1419a2af0d9707b20546ee078929ce99e8 | [
"MIT"
] | 1 | 2021-07-01T18:49:27.000Z | 2021-07-01T18:49:27.000Z | imputena/simple_imputation/linear_regression.py | macarro/imputena | 3a94ae1419a2af0d9707b20546ee078929ce99e8 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn import linear_model
import logging
def linear_regression(
data=None, dependent=None, predictors=None, regressions='available',
noise=False, inplace=False):
"""Performs simple or multiple linear regression imputation on the data.
First, the re... | 46.180812 | 79 | 0.696524 | import pandas as pd
import numpy as np
from sklearn import linear_model
import logging
def linear_regression(
data=None, dependent=None, predictors=None, regressions='available',
noise=False, inplace=False):
if not isinstance(data, pd.DataFrame):
raise TypeError('The data has to be a ... | true | true |
f715d03e6e3bce6f65c548086393381517fcc295 | 143 | py | Python | packages/pyolite-kernel/py/piplite/piplite/__init__.py | luzpaz/jupyterlite | 4b9d9419918a4ac53bb45b78a3d44d0ca2cd9665 | [
"BSD-3-Clause"
] | null | null | null | packages/pyolite-kernel/py/piplite/piplite/__init__.py | luzpaz/jupyterlite | 4b9d9419918a4ac53bb45b78a3d44d0ca2cd9665 | [
"BSD-3-Clause"
] | null | null | null | packages/pyolite-kernel/py/piplite/piplite/__init__.py | luzpaz/jupyterlite | 4b9d9419918a4ac53bb45b78a3d44d0ca2cd9665 | [
"BSD-3-Clause"
] | null | null | null | """A configurable Python package backed by Pyodide's micropip"""
from .piplite import install
__version__ = "0.1.0a23"
__all__ = ["install"]
| 20.428571 | 64 | 0.734266 | from .piplite import install
__version__ = "0.1.0a23"
__all__ = ["install"]
| true | true |
f715d0e64ba7e66d2862699c039894e7931be245 | 7,609 | py | Python | custom_components/jlrincontrol/services.py | stefferber/homeassistant-jlrincontrol | d11d931e097cc011047b1ad128f9a4340822117c | [
"MIT"
] | 27 | 2020-04-16T06:47:41.000Z | 2022-01-06T01:55:54.000Z | custom_components/jlrincontrol/services.py | stefferber/homeassistant-jlrincontrol | d11d931e097cc011047b1ad128f9a4340822117c | [
"MIT"
] | 40 | 2020-04-16T07:13:08.000Z | 2022-02-08T21:27:49.000Z | custom_components/jlrincontrol/services.py | stefferber/homeassistant-jlrincontrol | d11d931e097cc011047b1ad128f9a4340822117c | [
"MIT"
] | 15 | 2020-04-16T07:09:19.000Z | 2022-03-02T07:06:49.000Z | import inspect
import logging
import asyncio
from urllib import error
from functools import partial
from .const import DOMAIN, JLR_DATA
from .util import convert_temp_value
_LOGGER = logging.getLogger(__name__)
class JLRService:
def __init__(self, hass, config_entry, vin):
self.hass = hass
self.... | 37.29902 | 76 | 0.490078 | import inspect
import logging
import asyncio
from urllib import error
from functools import partial
from .const import DOMAIN, JLR_DATA
from .util import convert_temp_value
_LOGGER = logging.getLogger(__name__)
class JLRService:
def __init__(self, hass, config_entry, vin):
self.hass = hass
self.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.