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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f719804da78f16f6af3489ac457e49300a75a6b2 | 1,916 | py | Python | do_flask_mail.py | penglee87/lpython | 3a53322ccdebf83d6b358386518cf81712433c9e | [
"bzip2-1.0.6"
] | null | null | null | do_flask_mail.py | penglee87/lpython | 3a53322ccdebf83d6b358386518cf81712433c9e | [
"bzip2-1.0.6"
] | null | null | null | do_flask_mail.py | penglee87/lpython | 3a53322ccdebf83d6b358386518cf81712433c9e | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask
from flask_mail import Mail
from flask_mail import Message
import os
#测试成功,部分参数作用不明
app = Flask(__name__)
app.config['MAIL_SERVER'] = 'smtp.163.com'
app.config['MAIL_PORT'] = 25
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = 'pengl... | 26.246575 | 97 | 0.647182 |
from flask import Flask
from flask_mail import Mail
from flask_mail import Message
import os
app = Flask(__name__)
app.config['MAIL_SERVER'] = 'smtp.163.com'
app.config['MAIL_PORT'] = 25
app.config['MAIL_USE_TLS'] = True
app.config['MAIL_USERNAME'] = 'penglee87@163.com'
app.config['MAIL_PASSWORD'] = '******'
app.co... | true | true |
f71982541576d139123ce5e181dca42523d11d05 | 459 | py | Python | blog/search_indexes.py | GITliyanfeng/blog-django | a804702026a2d58664ec83a993116e17b89e9e8e | [
"MIT"
] | 2 | 2019-03-14T12:35:36.000Z | 2019-03-14T12:35:38.000Z | blog/search_indexes.py | GITliyanfeng/blog-django | a804702026a2d58664ec83a993116e17b89e9e8e | [
"MIT"
] | null | null | null | blog/search_indexes.py | GITliyanfeng/blog-django | a804702026a2d58664ec83a993116e17b89e9e8e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2019/3/19 0019 16:25
# @Author : __Yanfeng
# @Site :
# @File : search_indexes.py
# @Software: PyCharm
from haystack import indexes
from .models import Post
class PostIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=Tru... | 24.157895 | 62 | 0.67756 |
from haystack import indexes
from .models import Post
class PostIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
return Post
def index_queryset(self, using=None):
return self.get_model().latest_posts()
| true | true |
f7198316dcf1fee5ef6b1b5530246a472718064a | 109 | py | Python | rest_framework_security/deny_repeat_password/__init__.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 7 | 2020-09-01T09:55:25.000Z | 2021-11-04T06:59:04.000Z | rest_framework_security/deny_repeat_password/__init__.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 32 | 2020-10-28T17:09:18.000Z | 2022-03-12T00:55:09.000Z | rest_framework_security/deny_repeat_password/__init__.py | RubenEu/django-rest-framework-security | 638cf271c51a5bafd434a6b6a9c25a7c4849b485 | [
"MIT"
] | 2 | 2020-12-18T01:26:53.000Z | 2021-11-04T06:59:07.000Z | default_app_config = (
"rest_framework_security.deny_repeat_password.apps.DenyRepeatPasswordAppConfig"
)
| 27.25 | 83 | 0.844037 | default_app_config = (
"rest_framework_security.deny_repeat_password.apps.DenyRepeatPasswordAppConfig"
)
| true | true |
f71983d5a0a270119c6b7c7701a902ea4892f18a | 20,123 | py | Python | obstools/scripts/atacr_clean_spectra.py | paudetseis/OBStools | c6c02d8864c25a14f22d1fae17ff5ad911b9ff00 | [
"MIT"
] | 1 | 2019-12-05T04:32:38.000Z | 2019-12-05T04:32:38.000Z | obstools/scripts/atacr_clean_spectra.py | paudetseis/OBStools | c6c02d8864c25a14f22d1fae17ff5ad911b9ff00 | [
"MIT"
] | 2 | 2019-12-04T02:06:45.000Z | 2019-12-06T22:20:19.000Z | obstools/scripts/atacr_clean_spectra.py | paudetseis/OBStools | c6c02d8864c25a14f22d1fae17ff5ad911b9ff00 | [
"MIT"
] | 1 | 2020-02-25T16:51:35.000Z | 2020-02-25T16:51:35.000Z | #!/usr/bin/env python
# Copyright 2019 Pascal Audet & Helen Janiszewski
#
# This file is part of OBStools.
#
# 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 wi... | 34.28109 | 79 | 0.533718 |
import numpy as np
import pickle
import stdb
from obstools.atacr import StaNoise, Power, Cross, Rotation
from obstools.atacr import utils, plotting
from pathlib import Path
from argparse import ArgumentParser
from os.path import exists as exist
from obspy import UTCDateTime
from numpy import ... | true | true |
f7198466f423c197e1cd92a6791f6a97eeca93b9 | 2,362 | py | Python | tests/demos/test_demos.py | Nicolinho/RLBench | 3014e872f518d5439e73e057e2251dee1f9df481 | [
"BSD-3-Clause"
] | 619 | 2019-09-26T23:15:57.000Z | 2022-03-15T23:46:48.000Z | tests/demos/test_demos.py | Nicolinho/RLBench | 3014e872f518d5439e73e057e2251dee1f9df481 | [
"BSD-3-Clause"
] | 147 | 2019-09-27T02:22:45.000Z | 2022-03-30T08:37:43.000Z | tests/demos/test_demos.py | Nicolinho/RLBench | 3014e872f518d5439e73e057e2251dee1f9df481 | [
"BSD-3-Clause"
] | 142 | 2019-09-27T03:43:12.000Z | 2022-03-13T19:00:18.000Z | import unittest
import rlbench.backend.task as task
import os
from rlbench.backend.utils import task_file_to_task_class
from pyrep import PyRep
from pyrep.robots.arms.panda import Panda
from pyrep.robots.end_effectors.panda_gripper import PandaGripper
from rlbench.backend.const import TTT_FILE
from tools.task_validator... | 38.096774 | 78 | 0.610076 | import unittest
import rlbench.backend.task as task
import os
from rlbench.backend.utils import task_file_to_task_class
from pyrep import PyRep
from pyrep.robots.arms.panda import Panda
from pyrep.robots.end_effectors.panda_gripper import PandaGripper
from rlbench.backend.const import TTT_FILE
from tools.task_validator... | true | true |
f71986b928e02b3c1c5322f3668bc41a49a8abc1 | 7,013 | py | Python | GHC2018/process.py | purrcat259/n-n-hashcode | 98a1c443e6112903bc29a858bc18476a6635d460 | [
"MIT"
] | null | null | null | GHC2018/process.py | purrcat259/n-n-hashcode | 98a1c443e6112903bc29a858bc18476a6635d460 | [
"MIT"
] | null | null | null | GHC2018/process.py | purrcat259/n-n-hashcode | 98a1c443e6112903bc29a858bc18476a6635d460 | [
"MIT"
] | null | null | null | from GHC2018.input import Input
from GHC2018.models.Car import Car
from GHC2018.models.Route import Route
from GHC2018.models.ride import calculate_distance
from tqdm import tqdm
class Process:
def __init__(self, input_data, debug=True):
self.input_data = input_data
self.debug = debug
sel... | 39.178771 | 126 | 0.610866 | from GHC2018.input import Input
from GHC2018.models.Car import Car
from GHC2018.models.Route import Route
from GHC2018.models.ride import calculate_distance
from tqdm import tqdm
class Process:
def __init__(self, input_data, debug=True):
self.input_data = input_data
self.debug = debug
sel... | true | true |
f719878d7cf2f176cf391bedf04e4b2cfa47cc02 | 1,701 | py | Python | app/core/migrations/0001_initial.py | SirEric-A/recipe-app-api | 05a767fcb87f2ca47918698930d10f6e21654576 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | SirEric-A/recipe-app-api | 05a767fcb87f2ca47918698930d10f6e21654576 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | SirEric-A/recipe-app-api | 05a767fcb87f2ca47918698930d10f6e21654576 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-18 21:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.029412 | 266 | 0.637272 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField... | true | true |
f71987f0e511820af63a6cf60ad703869664ef65 | 4,832 | py | Python | .ycm_extra_conf.py | bigt1234/objectpool | dab515f71c12f8df22686053043f7e2c4c929354 | [
"Zlib"
] | 66 | 2016-11-07T01:00:46.000Z | 2022-03-13T01:25:54.000Z | .ycm_extra_conf.py | bigt1234/objectpool | dab515f71c12f8df22686053043f7e2c4c929354 | [
"Zlib"
] | 1 | 2020-11-26T12:08:53.000Z | 2021-09-24T01:06:49.000Z | .ycm_extra_conf.py | bigt1234/objectpool | dab515f71c12f8df22686053043f7e2c4c929354 | [
"Zlib"
] | 19 | 2016-07-18T07:58:11.000Z | 2022-03-13T01:24:07.000Z | #!/usr/bin/env python
#
# Copyright (C) 2014 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | 32.648649 | 79 | 0.708609 |
import os
import ycm_core
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-DNDEBUG',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't ... | true | true |
f71988e1a677b3eb305af40560a0785370f713df | 14,327 | py | Python | oqupy/backends/tempo_backend.py | tempoCollaboration/OQuPy | a389a161991a59259e5df47d8e0f405fcac75fe5 | [
"Apache-2.0"
] | 13 | 2022-02-15T12:33:17.000Z | 2022-03-31T10:01:57.000Z | oqupy/backends/tempo_backend.py | tempoCollaboration/OQuPy | a389a161991a59259e5df47d8e0f405fcac75fe5 | [
"Apache-2.0"
] | 11 | 2022-02-16T07:35:46.000Z | 2022-03-24T18:22:12.000Z | oqupy/backends/tempo_backend.py | tempoCollaboration/OQuPy | a389a161991a59259e5df47d8e0f405fcac75fe5 | [
"Apache-2.0"
] | 2 | 2022-02-17T01:23:55.000Z | 2022-02-17T08:51:57.000Z | # Copyright 2020 The TEMPO Collaboration
#
# 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... | 35.8175 | 79 | 0.520346 |
from typing import Callable, Dict, Optional, Tuple
from copy import copy
from numpy import ndarray, moveaxis, dot
from oqupy import operators
from oqupy.config import TEMPO_BACKEND_CONFIG
from oqupy.backends import node_array as na
from oqupy.util import create_delta
class BaseTempoBackend:
def __i... | true | true |
f71988f8e6cbe49da433af143788c3ecc8e82b65 | 446 | py | Python | setup.py | Moomoo-pls/NLP_Game_of_Life | afe6bb6ccd4a83b6ffeccc8ac257872251bd39bb | [
"MIT"
] | null | null | null | setup.py | Moomoo-pls/NLP_Game_of_Life | afe6bb6ccd4a83b6ffeccc8ac257872251bd39bb | [
"MIT"
] | null | null | null | setup.py | Moomoo-pls/NLP_Game_of_Life | afe6bb6ccd4a83b6ffeccc8ac257872251bd39bb | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="Moo_NLP_Game_of_Life",
version="1.0.0",
author="Stephen Moo-Young",
author_email="mooyoung12@gmail.com",
description="Game of Life for the take home coding challenge",
url="https://github.com/Moomoo-pls/NLP_Game_of_Life",
packages=setuptools.find_pa... | 27.875 | 66 | 0.663677 | import setuptools
setuptools.setup(
name="Moo_NLP_Game_of_Life",
version="1.0.0",
author="Stephen Moo-Young",
author_email="mooyoung12@gmail.com",
description="Game of Life for the take home coding challenge",
url="https://github.com/Moomoo-pls/NLP_Game_of_Life",
packages=setuptools.find_pa... | true | true |
f719891884a715f4ed60d4d29e0a80d1b2c17515 | 8,422 | py | Python | 2_data_collection/CIFAR_10/vgg16_CIFAR10.py | j-chan-hkust/deep_testing_of_advanced_learning_systems | ec535e2b4dc489d407b664a138d3f5262b71d21e | [
"MIT"
] | null | null | null | 2_data_collection/CIFAR_10/vgg16_CIFAR10.py | j-chan-hkust/deep_testing_of_advanced_learning_systems | ec535e2b4dc489d407b664a138d3f5262b71d21e | [
"MIT"
] | null | null | null | 2_data_collection/CIFAR_10/vgg16_CIFAR10.py | j-chan-hkust/deep_testing_of_advanced_learning_systems | ec535e2b4dc489d407b664a138d3f5262b71d21e | [
"MIT"
] | null | null | null | from __future__ import print_function
import keras
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization
from keras imp... | 39.172093 | 120 | 0.65412 | from __future__ import print_function
import keras
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization
from keras imp... | true | true |
f719892d08f0cb15a072c2fb5acf64d76d3bd3a3 | 31,288 | py | Python | scraps/forcefield_v2.py | kul-group/MAZE-sim | 0f85e74bf93f9242a73bcfaa20a593ae966f38fa | [
"MIT"
] | 13 | 2021-03-10T18:40:32.000Z | 2022-03-21T20:40:57.000Z | scraps/forcefield_v2.py | kul-group/MAZE-sim | 0f85e74bf93f9242a73bcfaa20a593ae966f38fa | [
"MIT"
] | 27 | 2021-01-28T23:18:44.000Z | 2021-05-06T19:33:09.000Z | scraps/forcefield_v2.py | kul-group/MAZE-sim | 0f85e74bf93f9242a73bcfaa20a593ae966f38fa | [
"MIT"
] | 4 | 2021-03-19T20:46:15.000Z | 2022-03-21T20:40:59.000Z | from maze.extra_framework_maker import ExtraFrameworkMaker, ExtraFrameworkAnalyzer
from maze.io_zeolite import read_vasp
from maze.zeolite import PerfectZeolite, Zeolite
from ase.neighborlist import natural_cutoffs, NeighborList
import os
from pathlib import Path
from ase.io import write, read, gromacs, proteindatabank... | 46.215657 | 121 | 0.685407 | from maze.extra_framework_maker import ExtraFrameworkMaker, ExtraFrameworkAnalyzer
from maze.io_zeolite import read_vasp
from maze.zeolite import PerfectZeolite, Zeolite
from ase.neighborlist import natural_cutoffs, NeighborList
import os
from pathlib import Path
from ase.io import write, read, gromacs, proteindatabank... | true | true |
f71989a26c51d5d0de8be179c705597a99ff7aea | 17,373 | py | Python | python/ccxt/async_support/bitbay.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 13 | 2019-01-26T14:41:37.000Z | 2022-03-26T03:33:12.000Z | python/ccxt/async_support/bitbay.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 17 | 2018-10-02T04:43:13.000Z | 2018-11-01T17:07:37.000Z | python/ccxt/async_support/bitbay.py | Richard-L-Johnson/ccxt1 | 903aa1288694f9192b15d22b945508661bdc8807 | [
"MIT"
] | 12 | 2018-12-24T02:19:02.000Z | 2022-03-26T05:04:25.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 50.650146 | 136 | 0.476141 |
rt.base.exchange import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.... | true | true |
f7198ae184bcaa5b0b938cc560dc8df6ff0d66d1 | 93,728 | py | Python | keras/layers/recurrent.py | Duncanswilson/keras | 32aa192548b6b59bf407e583fbd246ba9f5f5676 | [
"MIT"
] | 1 | 2017-11-01T19:10:35.000Z | 2017-11-01T19:10:35.000Z | keras/layers/recurrent.py | dmaniry/keras | 32aa192548b6b59bf407e583fbd246ba9f5f5676 | [
"MIT"
] | null | null | null | keras/layers/recurrent.py | dmaniry/keras | 32aa192548b6b59bf407e583fbd246ba9f5f5676 | [
"MIT"
] | 1 | 2019-02-22T03:06:41.000Z | 2019-02-22T03:06:41.000Z | # -*- coding: utf-8 -*-
"""Recurrent layers and their base classes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import warnings
from .. import backend as K
from .. import activations
from .. import initializers
from .. import regu... | 43.614705 | 130 | 0.583998 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import warnings
from .. import backend as K
from .. import activations
from .. import initializers
from .. import regularizers
from .. import constraints
from ..engine import Layer
from ..e... | true | true |
f7198b1249cfc281e7acad93f4e91961e055e201 | 13,206 | py | Python | mirage/libs/ble_utils/scapy_btlejack_layers.py | HomeSen/mirage | 6beb4df508758bd152f5d929ba3e6353f161ef27 | [
"MIT"
] | null | null | null | mirage/libs/ble_utils/scapy_btlejack_layers.py | HomeSen/mirage | 6beb4df508758bd152f5d929ba3e6353f161ef27 | [
"MIT"
] | null | null | null | mirage/libs/ble_utils/scapy_btlejack_layers.py | HomeSen/mirage | 6beb4df508758bd152f5d929ba3e6353f161ef27 | [
"MIT"
] | null | null | null | from scapy.all import *
'''
This module contains some scapy definitions for communicating with a BTLEJack device.
'''
BTLEJACK_PACKETS_TYPES = {
0x1 : "command",
0x2 : "response",
0x4 : "notification"
}
BTLEJACK_PACKETS_OPCODES = {
0x1 : "version",
0x2 : "reset",
0x3 : "scan_access_address... | 35.5 | 126 | 0.783659 | from scapy.all import *
BTLEJACK_PACKETS_TYPES = {
0x1 : "command",
0x2 : "response",
0x4 : "notification"
}
BTLEJACK_PACKETS_OPCODES = {
0x1 : "version",
0x2 : "reset",
0x3 : "scan_access_address",
0x4 : "recover",
0x5 : "recover_channel_map",
0x6 : "recover_hop_interval",
... | true | true |
f7198b76ba36f1f12ec60d6aea9e6f66c8d175da | 7,421 | py | Python | backend/server/models.py | thunderlink/thunderfish | a600021187a50bb078d9c36306564470cc6e9fd8 | [
"MIT"
] | 3 | 2019-04-18T04:45:27.000Z | 2019-11-06T18:17:29.000Z | backend/server/models.py | thunderlink/thunderfish | a600021187a50bb078d9c36306564470cc6e9fd8 | [
"MIT"
] | 59 | 2019-04-22T07:05:52.000Z | 2022-03-11T23:48:33.000Z | backend/server/models.py | thunderlink/thunderfish | a600021187a50bb078d9c36306564470cc6e9fd8 | [
"MIT"
] | 4 | 2019-04-24T05:49:21.000Z | 2019-11-21T00:26:00.000Z | from django.db import models
from django.contrib.auth.models import User
import re
from math import sqrt, pi
# Path to default image
DEFAULT_IMAGE = '../media/app_logo.png'
DEFAULT_PROFILE_IMG = 1
DEFAULT_MEETING_IMG = 2
MEDIA_URL = '/media/'
# Unique email for each user
User._meta.local_fields[7].__dict__['_unique'] ... | 41 | 229 | 0.694381 | from django.db import models
from django.contrib.auth.models import User
import re
from math import sqrt, pi
DEFAULT_IMAGE = '../media/app_logo.png'
DEFAULT_PROFILE_IMG = 1
DEFAULT_MEETING_IMG = 2
MEDIA_URL = '/media/'
User._meta.local_fields[7].__dict__['_unique'] = True
class Image(models.Model):
profile = mo... | true | true |
f7198bd1b623cee47276165d5348854e67b0535b | 45,311 | py | Python | pyNastran/dev/bdf_vectorized/cards/dynamic.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/dev/bdf_vectorized/cards/dynamic.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/dev/bdf_vectorized/cards/dynamic.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | 1 | 2020-10-04T19:28:07.000Z | 2020-10-04T19:28:07.000Z | # pylint: disable=C0103,R0902,R0904,R0914
"""
All dynamic control cards are defined in this file. This includes:
* FREQ
* FREQ1
* FREQ2 (not implemented)
* FREQ3
* FREQ4
* FREQ5 (not implemented)
* NLPCI
* NLPARM
* TSTEP
* TSTEPNL
All cards are BaseCard objects.
"""
from math import log, exp, ceil
import ... | 35.016229 | 96 | 0.493809 |
from math import log, exp, ceil
import numpy as np
from numpy import unique, hstack
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.field_writer_8 import set_blank_if_default
from pyNastran.bdf.cards.base_card import BaseCard
from pyNastran.bdf.bdf_interface.assign_type import (
integer, ... | true | true |
f7198c8a3b00d357347baf407e57a7dd4b984119 | 620 | py | Python | polls/admin.py | Obsinqsob01/polls | 52f42029bd76e7a4f1dbdc947c5217ca9e2c0f1d | [
"MIT"
] | null | null | null | polls/admin.py | Obsinqsob01/polls | 52f42029bd76e7a4f1dbdc947c5217ca9e2c0f1d | [
"MIT"
] | null | null | null | polls/admin.py | Obsinqsob01/polls | 52f42029bd76e7a4f1dbdc947c5217ca9e2c0f1d | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Choice, Question
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
list_display = ('question_text', 'pub_date')
class QuestionAdmin(admin.ModelAdmin):
list_display = ('question_text', 'pub_date', 'was_published_recently')
field... | 29.52381 | 80 | 0.659677 | from django.contrib import admin
from .models import Choice, Question
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
list_display = ('question_text', 'pub_date')
class QuestionAdmin(admin.ModelAdmin):
list_display = ('question_text', 'pub_date', 'was_published_recently')
field... | true | true |
f7198cbf53eb86b681a5ce28880882ab6561e873 | 706 | py | Python | 2-add-two-numbers/2-add-two-numbers.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | 1 | 2021-10-10T20:21:18.000Z | 2021-10-10T20:21:18.000Z | 2-add-two-numbers/2-add-two-numbers.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | 2-add-two-numbers/2-add-two-numbers.py | Atri10/Leet-code---Atri_Patel | 49fc59b9147a44ab04a66128fbb2ef259b5f7b7c | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
n = cur = ListNode(-1)
carry ... | 27.153846 | 98 | 0.441926 |
class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
n = cur = ListNode(-1)
carry = 0
while l1 or l2 or carry:
if l1:
carry += l1.val
l1 = l1.next
... | true | true |
f7198d790f74aa6993a89e96a1b3903ca05a53bc | 15,654 | py | Python | manim/scene/three_d_scene.py | behackl/manim | 3759b73d555792d077e1d77c854d5dbe88043b98 | [
"MIT"
] | 2 | 2020-11-17T19:00:44.000Z | 2021-10-17T16:14:55.000Z | manim/scene/three_d_scene.py | behackl/manim | 3759b73d555792d077e1d77c854d5dbe88043b98 | [
"MIT"
] | null | null | null | manim/scene/three_d_scene.py | behackl/manim | 3759b73d555792d077e1d77c854d5dbe88043b98 | [
"MIT"
] | null | null | null | """A scene suitable for rendering three-dimensional objects and animations."""
__all__ = ["ThreeDScene", "SpecialThreeDScene"]
from typing import Iterable, Optional, Sequence, Union
import numpy as np
from .. import config
from ..animation.animation import Animation
from ..animation.transform import ApplyMethod
fr... | 35.986207 | 100 | 0.622972 |
__all__ = ["ThreeDScene", "SpecialThreeDScene"]
from typing import Iterable, Optional, Sequence, Union
import numpy as np
from .. import config
from ..animation.animation import Animation
from ..animation.transform import ApplyMethod
from ..camera.three_d_camera import ThreeDCamera
from ..constants import DEGREES
... | true | true |
f7198e330d6123f84319f87eb566ae8978c38f58 | 7,124 | py | Python | corehq/apps/reports/urls.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | corehq/apps/reports/urls.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/apps/reports/urls.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.conf.urls import include, url
from django.core.exceptions import ImproperlyConfigured
from corehq.apps.reports.standard.forms.reports import ReprocessXFormErrorView
from corehq.apps.userreports.reports.view import (
ConfigurableReportView,
CustomConfigurableReportDispatcher,
)
from ... | 44.525 | 114 | 0.701291 | import logging
from django.conf.urls import include, url
from django.core.exceptions import ImproperlyConfigured
from corehq.apps.reports.standard.forms.reports import ReprocessXFormErrorView
from corehq.apps.userreports.reports.view import (
ConfigurableReportView,
CustomConfigurableReportDispatcher,
)
from ... | true | true |
f7198e35f24a43baae21005438b0076176ee416a | 561 | py | Python | oving_8_c.py | W3OP/Oving_9_round2 | 090cbc3b135840914659d50c6fa48ab756e5449e | [
"MIT"
] | null | null | null | oving_8_c.py | W3OP/Oving_9_round2 | 090cbc3b135840914659d50c6fa48ab756e5449e | [
"MIT"
] | null | null | null | oving_8_c.py | W3OP/Oving_9_round2 | 090cbc3b135840914659d50c6fa48ab756e5449e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 22 10:13:37 2021
@author: palme
"""
import oving_8_b as o8b
test = o8b.Quiz("Hvor mange bein har en hest", [1, 2, 3, 4],4)
print(test)
dude = int(input("Svar: "))
svar1 = test.svaret(dude)
if svar1:
print("Svaret er rett")
else:
print("Svaret er feil")
print... | 15.162162 | 77 | 0.611408 |
import oving_8_b as o8b
test = o8b.Quiz("Hvor mange bein har en hest", [1, 2, 3, 4],4)
print(test)
dude = int(input("Svar: "))
svar1 = test.svaret(dude)
if svar1:
print("Svaret er rett")
else:
print("Svaret er feil")
print("\n \n")
test2 = o8b.Quiz("Hvilket land er i i nå?", ["norge", "sverie", "danmar... | true | true |
f7198ec98548e880b167ef7ccfc9be00d9b58137 | 5,121 | py | Python | zipkin/binding/pyramid/pyramidhook.py | Themimitoof/python-zipkin | f91169d044a49f641930bdfc456f34e497690fe8 | [
"Apache-2.0"
] | null | null | null | zipkin/binding/pyramid/pyramidhook.py | Themimitoof/python-zipkin | f91169d044a49f641930bdfc456f34e497690fe8 | [
"Apache-2.0"
] | null | null | null | zipkin/binding/pyramid/pyramidhook.py | Themimitoof/python-zipkin | f91169d044a49f641930bdfc456f34e497690fe8 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import time
import logging
from pyramid.tweens import INGRESS
from pyramid.settings import aslist
from zipkin import local
from zipkin.api import stack_trace
from zipkin.models import Trace, Annotation
from zipkin.util import int_or_none
from zipkin.client import log as zipkin_l... | 32.617834 | 101 | 0.641672 | from __future__ import absolute_import
import time
import logging
from pyramid.tweens import INGRESS
from pyramid.settings import aslist
from zipkin import local
from zipkin.api import stack_trace
from zipkin.models import Trace, Annotation
from zipkin.util import int_or_none
from zipkin.client import log as zipkin_l... | true | true |
f7198ece6a41b7a5f0f2edead87cf05f2c1c0cd4 | 10,093 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_bayes.py | onilton/polyaxon | 3b0d7cbeead74e62eb0eedbb2962f605ebb9fa81 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_bayes.py | onilton/polyaxon | 3b0d7cbeead74e62eb0eedbb2962f605ebb9fa81 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_bayes.py | onilton/polyaxon | 3b0d7cbeead74e62eb0eedbb2962f605ebb9fa81 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.13172 | 237 | 0.593382 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1Bayes(object):
openapi_types = {
'kind': 'str',
'params': 'dict(str, object)',
'num_initial_runs': 'int',
'max_iterations': 'int',
'utility_function': 'o... | true | true |
f7198f349b0048d3b6330725d65dfdf36b553ff4 | 1,458 | py | Python | soltrannet/__init__.py | hengwei-chan/molecular_attention_transformer | 29193d4155df528e3a6a0c1e0da39111d0b8db93 | [
"Apache-2.0"
] | 16 | 2021-03-10T17:10:06.000Z | 2022-03-16T13:07:58.000Z | soltrannet/__init__.py | hengwei-chan/molecular_attention_transformer | 29193d4155df528e3a6a0c1e0da39111d0b8db93 | [
"Apache-2.0"
] | null | null | null | soltrannet/__init__.py | hengwei-chan/molecular_attention_transformer | 29193d4155df528e3a6a0c1e0da39111d0b8db93 | [
"Apache-2.0"
] | 10 | 2021-06-01T03:36:08.000Z | 2022-03-18T16:58:25.000Z | from .predict import predict
import argparse
import sys, multiprocessing
import torch
def _parse_args():
parser=argparse.ArgumentParser(description="Run SolTranNet aqueous solubility predictor")
parser.add_argument('input',nargs='?',type=argparse.FileType('r'),default=sys.stdin,help='PATH to the file containi... | 52.071429 | 199 | 0.739369 | from .predict import predict
import argparse
import sys, multiprocessing
import torch
def _parse_args():
parser=argparse.ArgumentParser(description="Run SolTranNet aqueous solubility predictor")
parser.add_argument('input',nargs='?',type=argparse.FileType('r'),default=sys.stdin,help='PATH to the file containi... | true | true |
f7198f927dcfc0aeb6186a86d48263d8c4b1d8eb | 5,831 | py | Python | src/garage/torch/algos/_utils.py | adibellathur/garage | 8394f0cf2b77c0a5b3a7b1ea977fa6cb3f9df0ca | [
"MIT"
] | 1 | 2020-02-19T00:01:29.000Z | 2020-02-19T00:01:29.000Z | src/garage/torch/algos/_utils.py | Ashutosh-Adhikari/garage | 482a26a07d46091f878c41b582f1478588e397ff | [
"MIT"
] | null | null | null | src/garage/torch/algos/_utils.py | Ashutosh-Adhikari/garage | 482a26a07d46091f878c41b582f1478588e397ff | [
"MIT"
] | 1 | 2020-02-13T12:05:35.000Z | 2020-02-13T12:05:35.000Z | """Utility functions used by PyTorch algorithms."""
import torch
import torch.nn.functional as F
class _Default: # pylint: disable=too-few-public-methods
"""A wrapper class to represent default arguments.
Args:
val (object): Argument value.
"""
def __init__(self, val):
self.val = v... | 35.993827 | 79 | 0.630081 | import torch
import torch.nn.functional as F
class _Default:
def __init__(self, val):
self.val = val
def make_optimizer(optimizer_type, module, **kwargs):
if isinstance(optimizer_type, tuple):
opt_type, opt_args = optimizer_type
for name, arg in kwargs.items():
if not ... | true | true |
f7198f9535491c7521d5ae47ee77aaa8910d0441 | 801 | py | Python | tests/test_export_id.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | null | null | null | tests/test_export_id.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | 2 | 2022-02-13T19:49:18.000Z | 2022-02-13T19:49:18.000Z | tests/test_export_id.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | null | null | null | import json
import os
from pathlib import Path
from sphinx_testing import with_app
@with_app(buildername="needs", srcdir="doc_test/doc_export_id")
def test_export_id(app, status, warning):
app.build()
content = Path(app.outdir, "needs.json").read_text()
assert "filters" in content
content_obj = json... | 30.807692 | 69 | 0.716604 | import json
import os
from pathlib import Path
from sphinx_testing import with_app
@with_app(buildername="needs", srcdir="doc_test/doc_export_id")
def test_export_id(app, status, warning):
app.build()
content = Path(app.outdir, "needs.json").read_text()
assert "filters" in content
content_obj = json... | true | true |
f719907ff48a40bf779cf6020839f0d298c921ad | 7,308 | py | Python | wavedata/tools/core/voxel_grid_2d.py | amuamushu/wavedata | 1745c646ff3a76b38a81c439a0edd900c986c9f7 | [
"MIT"
] | null | null | null | wavedata/tools/core/voxel_grid_2d.py | amuamushu/wavedata | 1745c646ff3a76b38a81c439a0edd900c986c9f7 | [
"MIT"
] | null | null | null | wavedata/tools/core/voxel_grid_2d.py | amuamushu/wavedata | 1745c646ff3a76b38a81c439a0edd900c986c9f7 | [
"MIT"
] | null | null | null | import numpy as np
from wavedata.wavedata.tools.core import geometry_utils
class VoxelGrid2D(object):
"""
Voxel grids represent occupancy info. The voxelize_2d method projects a point cloud
onto a plane, while saving height and point density information for each voxel.
"""
# Class Constants
... | 39.080214 | 87 | 0.601122 | import numpy as np
from wavedata.wavedata.tools.core import geometry_utils
class VoxelGrid2D(object):
VOXEL_EMPTY = -1
VOXEL_FILLED = 0
def __init__(self):
self.voxel_size = 0.0
self.min_voxel_coord = np.array([])
self.max_voxel_coord = np.array([])
... | true | true |
f719919bea61d2bf5cccc3f7d4e1bee9157cfd2e | 1,230 | py | Python | service/scripts/resetadmin.py | OA-DeepGreen/jper | 042719a790a34f877050a32f896b947ce4407b4e | [
"Apache-2.0"
] | null | null | null | service/scripts/resetadmin.py | OA-DeepGreen/jper | 042719a790a34f877050a32f896b947ce4407b4e | [
"Apache-2.0"
] | 1 | 2022-02-03T12:35:18.000Z | 2022-02-03T12:35:18.000Z | service/scripts/resetadmin.py | OA-DeepGreen/jper | 042719a790a34f877050a32f896b947ce4407b4e | [
"Apache-2.0"
] | 3 | 2016-07-15T07:29:33.000Z | 2020-02-03T11:20:34.000Z | """
This is a script to reset the admin account in a live system.
On production this should be run once, and never again, as it removes the old
account and builds a new one in its place. This means no historical data will
be kept from the before time.
"""
from octopus.core import add_configuration, app
from servic... | 31.538462 | 139 | 0.664228 | from octopus.core import add_configuration, app
from service.models import Account
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", help="additional configuration to load (e.g. for testing)")
args = parser.parse_args()
if arg... | true | true |
f719923795059f5abc5f26d2960058e68c7ca4e6 | 539 | py | Python | game_data/migrations/0003_auto_20210103_1621.py | cmerwin3/Adventure_Project | 1816978e952f1250049e8d1e7fcf172620903596 | [
"Apache-2.0"
] | null | null | null | game_data/migrations/0003_auto_20210103_1621.py | cmerwin3/Adventure_Project | 1816978e952f1250049e8d1e7fcf172620903596 | [
"Apache-2.0"
] | null | null | null | game_data/migrations/0003_auto_20210103_1621.py | cmerwin3/Adventure_Project | 1816978e952f1250049e8d1e7fcf172620903596 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.1 on 2021-01-03 22:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game_data', '0002_auto_20201220_2025'),
]
operations = [
migrations.RemoveField(
model_name='gamedata',
name='pin',
... | 22.458333 | 61 | 0.575139 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game_data', '0002_auto_20201220_2025'),
]
operations = [
migrations.RemoveField(
model_name='gamedata',
name='pin',
),
migrations.AddField(
... | true | true |
f719927ab980abbbc3d3ffdce109f65dd7ddd35e | 118 | py | Python | framework/conf.py | shew91/Retropy | 9feb34855b997c48d93a5343a9842788d19582e6 | [
"MIT"
] | 13 | 2018-06-02T09:11:15.000Z | 2020-08-29T01:01:19.000Z | framework/conf.py | shew91/Retropy | 9feb34855b997c48d93a5343a9842788d19582e6 | [
"MIT"
] | 1 | 2021-01-17T14:03:13.000Z | 2021-01-17T14:03:13.000Z | framework/conf.py | shew91/Retropy | 9feb34855b997c48d93a5343a9842788d19582e6 | [
"MIT"
] | 6 | 2018-06-02T16:20:47.000Z | 2021-12-30T22:26:54.000Z | # (hack) Global configs
conf_cache_disk = True
conf_cache_memory = True
conf_cache_fails = False
ignoredAssets = []
| 14.75 | 24 | 0.771186 |
conf_cache_disk = True
conf_cache_memory = True
conf_cache_fails = False
ignoredAssets = []
| true | true |
f71992c33b60881673856eebed695c0f089619b3 | 8,381 | py | Python | adwords_python3_examples_10.1.0/v201802/shopping/add_product_partition_tree.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/shopping/add_product_partition_tree.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201802/shopping/add_product_partition_tree.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# 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 requir... | 29.932143 | 79 | 0.681064 |
from googleads import adwords
ADGROUP_ID = 'INSERT_AD_GROUP_ID_HERE'
class ProductPartitionHelper(object):
def __init__(self, adgroup_id):
self.next_id = -1
self.operations = []
self.adgroup_id = adgroup_id
def CreateSubdivision(self, ... | true | true |
f71992ce83b2d3db02c5c551a3d398f75815bd4c | 1,118 | py | Python | tests/test_integration.py | vadim2404/pybox | 3c4686245dca3d58afa5b923bcfede2172436bfd | [
"MIT"
] | null | null | null | tests/test_integration.py | vadim2404/pybox | 3c4686245dca3d58afa5b923bcfede2172436bfd | [
"MIT"
] | null | null | null | tests/test_integration.py | vadim2404/pybox | 3c4686245dca3d58afa5b923bcfede2172436bfd | [
"MIT"
] | null | null | null | from pybox.inject import Inject, InjectLazy
from pybox.service import IService, ServiceMode
class SingletonService(IService):
def who_am_i(self):
print(f'Singleton {id(self)}')
class FactoryService(IService):
singleton = Inject(SingletonService)
@classmethod
def service_mode(self):
... | 23.787234 | 53 | 0.701252 | from pybox.inject import Inject, InjectLazy
from pybox.service import IService, ServiceMode
class SingletonService(IService):
def who_am_i(self):
print(f'Singleton {id(self)}')
class FactoryService(IService):
singleton = Inject(SingletonService)
@classmethod
def service_mode(self):
... | true | true |
f719931b5d6abfb3ad9bbf8bcd7dabd34ac4e957 | 1,023 | py | Python | stacked_queue/stack_queue.py | steveflys/data-structures-and-algorithms | 9c89cb24449ca7bc09578408cba3c877fe74e000 | [
"MIT"
] | null | null | null | stacked_queue/stack_queue.py | steveflys/data-structures-and-algorithms | 9c89cb24449ca7bc09578408cba3c877fe74e000 | [
"MIT"
] | 3 | 2018-05-01T18:07:50.000Z | 2018-05-11T16:52:16.000Z | stacked_queue/stack_queue.py | steveflys/data-structures-and-algorithms | 9c89cb24449ca7bc09578408cba3c877fe74e000 | [
"MIT"
] | null | null | null | from .node import Node
from .stack import Stack
class Stack_Queue:
def __init__(self):
self.stack_front = Stack()
self.stack_back = Stack()
self._size = 0
def enqueue(self, val):
"""This will add a node the back of the queue and increment the ._size"""
try:
... | 25.575 | 98 | 0.605083 | from .node import Node
from .stack import Stack
class Stack_Queue:
def __init__(self):
self.stack_front = Stack()
self.stack_back = Stack()
self._size = 0
def enqueue(self, val):
try:
node = Node(val)
except TypeError:
raise TypeError('Cannot en... | true | true |
f7199346c4d451ef333dfac98139b138cfe947b2 | 1,924 | py | Python | _discord.py | blairg23/discord-scheduler-bot | bd6bcc25b51b50c9eeca195adefe5cfc2eab4923 | [
"MIT"
] | null | null | null | _discord.py | blairg23/discord-scheduler-bot | bd6bcc25b51b50c9eeca195adefe5cfc2eab4923 | [
"MIT"
] | null | null | null | _discord.py | blairg23/discord-scheduler-bot | bd6bcc25b51b50c9eeca195adefe5cfc2eab4923 | [
"MIT"
] | null | null | null | import discord
import asyncio
from datetime import datetime
class Discord:
_instance = None
client = None
def __new__(class_, *args, **kwargs):
if not isinstance(class_._instance, class_):
class_._instance = object.__new__(class_, *args, **kwargs)
return class_._instance
d... | 34.357143 | 118 | 0.576403 | import discord
import asyncio
from datetime import datetime
class Discord:
_instance = None
client = None
def __new__(class_, *args, **kwargs):
if not isinstance(class_._instance, class_):
class_._instance = object.__new__(class_, *args, **kwargs)
return class_._instance
d... | true | true |
f719938d7b8a9a714e3e8d344249a6a2588ede43 | 3,085 | py | Python | src/app/routes.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | null | null | null | src/app/routes.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | null | null | null | src/app/routes.py | taishengG/jama-slack-integration | 746b7186ceaf955ca81e9e0ad4862141ce35eb8d | [
"MIT"
] | null | null | null | import os
import requests
import json
from flask import request, make_response
from app import app
from app import route_handler as rt_handle
"""
This module handles the "intake" of requests to the server.
The requests are then passed off the route_handler.py where arguments
are then parsed and passed off to other pa... | 24.879032 | 72 | 0.666775 | import os
import requests
import json
from flask import request, make_response
from app import app
from app import route_handler as rt_handle
base_url = os.environ['JAMA_URL']
url_rule = os.environ['URL_RULE']
@app.route(url_rule + "/dialog", methods=['GET', 'PUT', 'POST'])
def jama_dialog():
if not rt_handle.... | true | true |
f719944e384288656e4d709f07457f69d21c6a92 | 1,473 | pyw | Python | Tkinter/tk5.pyw | Jav10/Python | b419a86825313b8ee537757079c95f3097f4dbad | [
"MIT"
] | null | null | null | Tkinter/tk5.pyw | Jav10/Python | b419a86825313b8ee537757079c95f3097f4dbad | [
"MIT"
] | null | null | null | Tkinter/tk5.pyw | Jav10/Python | b419a86825313b8ee537757079c95f3097f4dbad | [
"MIT"
] | null | null | null | #GUI con TKinter
#Autor: Javier Arturo Hernández Sosa
#Fecha: 20/Sep/2017
#Descripcion: Curso Python FES Acatlán
from tkinter import *
#Definición de funciones
def suma():
r.set(x.get() + y.get())
def multi():
r.set(x.get() * y.get())
def resta():
r.set(x.get() - y.get())
def dividir():
r.s... | 25.396552 | 108 | 0.696538 |
from tkinter import *
def suma():
r.set(x.get() + y.get())
def multi():
r.set(x.get() * y.get())
def resta():
r.set(x.get() - y.get())
def dividir():
r.set(x.get() / y.get())
root = Tk()
root.geometry("300x300")
root.title("Botones y funciones")
root.config(bd=15)
x = DoubleVar(... | true | true |
f719946d0d254ecdc9ccfe5fb6f0233c8c62eb2a | 1,485 | py | Python | src/data/dataset.py | zmcx16/ReclassifyAnimeCG | f5f95b229447564502564d9ffc7edf6215fec83d | [
"MIT"
] | 3 | 2021-10-30T10:13:40.000Z | 2021-12-12T10:26:14.000Z | src/data/dataset.py | zmcx16/ReclassifyAnimeCG | f5f95b229447564502564d9ffc7edf6215fec83d | [
"MIT"
] | null | null | null | src/data/dataset.py | zmcx16/ReclassifyAnimeCG | f5f95b229447564502564d9ffc7edf6215fec83d | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import Dataset, DataLoader
import numpy as np
from PIL import Image
Image.MAX_IMAGE_PIXELS = None
from data import get_train_transform, get_test_transform
class CustomDataset(Dataset):
img_aug = True
imgs = []
transform = None
def __init__(self, label_file, image_s... | 30.9375 | 90 | 0.658586 | import torch
from torch.utils.data import Dataset, DataLoader
import numpy as np
from PIL import Image
Image.MAX_IMAGE_PIXELS = None
from data import get_train_transform, get_test_transform
class CustomDataset(Dataset):
img_aug = True
imgs = []
transform = None
def __init__(self, label_file, image_s... | true | true |
f71994d1600fc241664b82c32779973864dfe5a1 | 337 | py | Python | AHtask2.py | Irinakene/AHtask | 6f776477c6867b8f7650394aac1c3292bced8ca9 | [
"MIT"
] | null | null | null | AHtask2.py | Irinakene/AHtask | 6f776477c6867b8f7650394aac1c3292bced8ca9 | [
"MIT"
] | null | null | null | AHtask2.py | Irinakene/AHtask | 6f776477c6867b8f7650394aac1c3292bced8ca9 | [
"MIT"
] | null | null | null | import csv
name = input('Enter your name: ')
email = input('Enter your email: ')
phone = input('Enter your phone: ')
githublink = input('Enter your githublink: ')
save = input('Save to CSV? ')
if save == 'yes':
file = open('results.csv', 'a')
csv_writer = csv.writer(file)
csv_writer.writerow([name, githublin... | 22.466667 | 54 | 0.664688 | import csv
name = input('Enter your name: ')
email = input('Enter your email: ')
phone = input('Enter your phone: ')
githublink = input('Enter your githublink: ')
save = input('Save to CSV? ')
if save == 'yes':
file = open('results.csv', 'a')
csv_writer = csv.writer(file)
csv_writer.writerow([name, githublin... | true | true |
f71997563231cf56306173544d65e6f6f5c14345 | 27,571 | py | Python | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2021-05-31T08:56:01.000Z | 2021-05-31T08:56:01.000Z | sdk/keyvault/azure-keyvault-keys/azure/keyvault/keys/_client.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from functools import partial
from azure.core.tracing.decorator import distributed_trace
from ._shared import KeyVaultClientBase
from ._shared.exceptions import error_m... | 45.875208 | 120 | 0.641507 |
from functools import partial
from azure.core.tracing.decorator import distributed_trace
from ._shared import KeyVaultClientBase
from ._shared.exceptions import error_map as _error_map
from ._shared._polling import DeleteRecoverPollingMethod, KeyVaultOperationPoller
from ._models import KeyVaultKey, KeyProperties,... | true | true |
f7199764cac1f3e56cc1b5f43ff6f14fb40c8601 | 3,487 | py | Python | tests/test_cookies.py | tripsolutions/pyramid_jwt | 320ed080216971467ae5e12b1f9888b50a9a29b7 | [
"BSD-2-Clause"
] | null | null | null | tests/test_cookies.py | tripsolutions/pyramid_jwt | 320ed080216971467ae5e12b1f9888b50a9a29b7 | [
"BSD-2-Clause"
] | null | null | null | tests/test_cookies.py | tripsolutions/pyramid_jwt | 320ed080216971467ae5e12b1f9888b50a9a29b7 | [
"BSD-2-Clause"
] | null | null | null | import uuid
import pytest
from pyramid.interfaces import IAuthenticationPolicy
from webob import Request
from zope.interface.verify import verifyObject
from pyramid_jwt.policy import JWTCookieAuthenticationPolicy
@pytest.fixture(scope="module")
def principal():
return str(uuid.uuid4())
def test_interface():
... | 29.058333 | 88 | 0.706051 | import uuid
import pytest
from pyramid.interfaces import IAuthenticationPolicy
from webob import Request
from zope.interface.verify import verifyObject
from pyramid_jwt.policy import JWTCookieAuthenticationPolicy
@pytest.fixture(scope="module")
def principal():
return str(uuid.uuid4())
def test_interface():
... | true | true |
f719982c32746d402b0277ba15a13000bcc77119 | 94 | py | Python | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/main_20210726185941.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/main_20210726185941.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/.history/ModulesPackages_PackageNamespaces/example3b/main_20210726185941.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null |
import sys
import importer
module1 = importer.import_('module1', 'module1_source.py', '.')
| 13.428571 | 63 | 0.723404 |
import sys
import importer
module1 = importer.import_('module1', 'module1_source.py', '.')
| true | true |
f719994b12c769c14062f52ec104eb9f369ef914 | 757 | py | Python | Exercicios Loop/exercicio 35 - secao 06.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | Exercicios Loop/exercicio 35 - secao 06.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | Exercicios Loop/exercicio 35 - secao 06.py | cristinamais/exercicios_python | 8a09b0b68ffaa62d13afb952998e890a79667c7e | [
"MIT"
] | null | null | null | """
35 - Faça um programa que some os números impares contidos em um intervalo definido pelo usuário.
O usuário define o valor inicial do intervalo e o valor final deste intervalo e o programa deve
somar todos os números ímpares contidos neste intervalo (começando por um valor maior que o valor final)
deve ser escrito ... | 42.055556 | 104 | 0.73712 | impar = 0
inicial, final = [int(x) for x in input("Digite o valor inicial e valor final: ").split()]
for i in list(range(inicial, final)):
if i % 2 != 0:
impar = impar + i
print(f'A soma dos ímpares neste intervalo é {impar}')
| true | true |
f71999d547a46a0a1493f4a1de55c28d65419f04 | 421 | py | Python | strava/cli/activity/commands.py | dparret/strava-cli | 2426ea7f3fe4580aea352476b261cec31d3f0b11 | [
"MIT"
] | null | null | null | strava/cli/activity/commands.py | dparret/strava-cli | 2426ea7f3fe4580aea352476b261cec31d3f0b11 | [
"MIT"
] | null | null | null | strava/cli/activity/commands.py | dparret/strava-cli | 2426ea7f3fe4580aea352476b261cec31d3f0b11 | [
"MIT"
] | null | null | null | import click
from strava.commands import get_activity, get_constrain_activity, get_weekly_activity, get_lap_activity
@click.group(name='activity', help='[GROUP] Get the summary of one or multiple activities.')
def cli_activity():
pass
cli_activity.add_command(get_activity)
cli_activity.add_command(get_constrai... | 28.066667 | 103 | 0.83848 | import click
from strava.commands import get_activity, get_constrain_activity, get_weekly_activity, get_lap_activity
@click.group(name='activity', help='[GROUP] Get the summary of one or multiple activities.')
def cli_activity():
pass
cli_activity.add_command(get_activity)
cli_activity.add_command(get_constrai... | true | true |
f7199aebd95eaaf673576198d3754ac18ebe3786 | 4,928 | py | Python | 3.Netdata_package/zipcontents/bin/netdata/usr/libexec/netdata/python.d/cpuidle.chart.py | NordicID/ar8x_samples | 2ac78750d6f4ff924628d1e225990f4bfcecfda0 | [
"MIT"
] | 4 | 2017-10-17T13:28:28.000Z | 2020-12-23T09:46:10.000Z | 3.Netdata_package/zipcontents/bin/netdata/usr/libexec/netdata/python.d/cpuidle.chart.py | NordicID/ar8x_samples | 2ac78750d6f4ff924628d1e225990f4bfcecfda0 | [
"MIT"
] | 8 | 2019-02-09T15:29:12.000Z | 2021-03-15T17:45:49.000Z | 3.Netdata_package/zipcontents/bin/netdata/usr/libexec/netdata/python.d/cpuidle.chart.py | NordicID/ar8x_samples | 2ac78750d6f4ff924628d1e225990f4bfcecfda0 | [
"MIT"
] | 3 | 2018-05-24T16:27:43.000Z | 2019-08-04T23:39:22.000Z | # -*- coding: utf-8 -*-
# Description: cpuidle netdata python.d module
# Author: Steven Noonan (tycho)
import glob
import os
import platform
import time
from base import SimpleService
import ctypes
syscall = ctypes.CDLL('libc.so.6').syscall
# default module values (can be overridden per job in `config`)
# update_eve... | 34.222222 | 96 | 0.565544 |
import glob
import os
import platform
import time
from base import SimpleService
import ctypes
syscall = ctypes.CDLL('libc.so.6').syscall
class Service(SimpleService):
def __init__(self, configuration=None, name=None):
prefix = os.getenv('NETDATA_HOST_PREFIX', "")
if prefix.endswith('/'):
... | true | true |
f7199b4c4ff664a5de4259b1a156f514807f75ec | 358 | py | Python | Ch6/picnic_table.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | null | null | null | Ch6/picnic_table.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | null | null | null | Ch6/picnic_table.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | null | null | null | def print_picnic(itemsDict, leftWidth, rightWidth):
print('PICNIC ITEMS'.center(leftWidth + rightWidth, '-'))
for k, v in itemsDict.items():
print(k.ljust(leftWidth, '.') + str(v).rjust(rightWidth))
picnic_items = {'sandwiches': 4, 'apples': 12, 'cups': 4, 'cookies': 8000}
print_picnic(picnic_items, 12,... | 44.75 | 74 | 0.684358 | def print_picnic(itemsDict, leftWidth, rightWidth):
print('PICNIC ITEMS'.center(leftWidth + rightWidth, '-'))
for k, v in itemsDict.items():
print(k.ljust(leftWidth, '.') + str(v).rjust(rightWidth))
picnic_items = {'sandwiches': 4, 'apples': 12, 'cups': 4, 'cookies': 8000}
print_picnic(picnic_items, 12,... | true | true |
f7199b6017b06f096a888ac161723abab17bf6d1 | 80 | py | Python | notebooks/_solutions/13-raster-processing42.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 58 | 2020-10-09T10:10:59.000Z | 2022-03-07T14:58:07.000Z | notebooks/_solutions/13-raster-processing42.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 24 | 2020-09-30T19:57:14.000Z | 2021-10-05T07:21:09.000Z | notebooks/_solutions/13-raster-processing42.py | jorisvandenbossche/DS-python-geospatial | 893a12edc5c203a75815f6dcb5f1e18c577c8cd5 | [
"BSD-3-Clause"
] | 19 | 2020-10-05T09:32:18.000Z | 2022-03-20T00:09:14.000Z | green = geopandas.read_file("data/gent/vector/parken-gent.geojson")
green.head() | 40 | 67 | 0.7875 | green = geopandas.read_file("data/gent/vector/parken-gent.geojson")
green.head() | true | true |
f7199bd2f937de5095eb9d5c4cafe386b70039eb | 1,325 | py | Python | kale/util/ints.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | kale/util/ints.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | kale/util/ints.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | from typing import Any, BinaryIO
from kale.util.struct_stream import StructStream
class int8(StructStream):
PACK = "!b"
class uint8(StructStream):
PACK = "!B"
class int16(StructStream):
PACK = "!h"
class uint16(StructStream):
PACK = "!H"
class int32(StructStream):
PACK = "!l"
class uint... | 20.384615 | 61 | 0.577358 | from typing import Any, BinaryIO
from kale.util.struct_stream import StructStream
class int8(StructStream):
PACK = "!b"
class uint8(StructStream):
PACK = "!B"
class int16(StructStream):
PACK = "!h"
class uint16(StructStream):
PACK = "!H"
class int32(StructStream):
PACK = "!l"
class uint... | true | true |
f7199cc541ada1d15fae75b62fc319d80df9c669 | 428 | py | Python | src/upload/admin.py | bpilkerton/vendor-upload | ba43b620340c9fffd26cf6a8ee5bc9f97ffabda1 | [
"Unlicense"
] | null | null | null | src/upload/admin.py | bpilkerton/vendor-upload | ba43b620340c9fffd26cf6a8ee5bc9f97ffabda1 | [
"Unlicense"
] | null | null | null | src/upload/admin.py | bpilkerton/vendor-upload | ba43b620340c9fffd26cf6a8ee5bc9f97ffabda1 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Upload,VendorData
class UploadAdmin(admin.ModelAdmin):
list_display = ('id','uploaded_file','uploaded_date')
class VendordataAdmin(admin.ModelAdmin):
list_display = ('id','sub_id','first_name','last_name','status')
admin.site.site_header = "Subscription Fu... | 32.923077 | 68 | 0.785047 | from django.contrib import admin
from .models import Upload,VendorData
class UploadAdmin(admin.ModelAdmin):
list_display = ('id','uploaded_file','uploaded_date')
class VendordataAdmin(admin.ModelAdmin):
list_display = ('id','sub_id','first_name','last_name','status')
admin.site.site_header = "Subscription Fu... | true | true |
f7199d3d3a6e51cfe86975c9d26b03a1bb377073 | 228 | py | Python | Django Rest Class Based API view/Person/admin.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | Django Rest Class Based API view/Person/admin.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | Django Rest Class Based API view/Person/admin.py | abhisheksahu92/Django-Rest-Framework | 45ddafb93ed1f2e232d2f537f144bf79cb30bf3d | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Person
# Register your models here.
@admin.register(Person)
class PersonModel(admin.ModelAdmin):
list_display = ['first_name','last_name','email','phone','date_of_birth'] | 32.571429 | 77 | 0.77193 | from django.contrib import admin
from .models import Person
@admin.register(Person)
class PersonModel(admin.ModelAdmin):
list_display = ['first_name','last_name','email','phone','date_of_birth'] | true | true |
f7199de7d432eb5ce623737f74e8d53b751b22d7 | 9,267 | py | Python | ckan/views/admin.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 1 | 2021-10-01T12:47:19.000Z | 2021-10-01T12:47:19.000Z | ckan/views/admin.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | null | null | null | ckan/views/admin.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 2 | 2018-01-21T17:03:08.000Z | 2019-07-23T08:49:52.000Z | # encoding: utf-8
from __future__ import annotations
import logging
from typing import Any, Union, cast, List
from flask import Blueprint
from flask.views import MethodView
from flask.wrappers import Response
import ckan.lib.app_globals as app_globals
import ckan.lib.base as base
import ckan.lib.helpers as h
import ... | 33.698182 | 79 | 0.589403 |
from __future__ import annotations
import logging
from typing import Any, Union, cast, List
from flask import Blueprint
from flask.views import MethodView
from flask.wrappers import Response
import ckan.lib.app_globals as app_globals
import ckan.lib.base as base
import ckan.lib.helpers as h
import ckan.lib.navl.dic... | true | true |
f7199e876ff568e200ceb2dbf17c8e228d670c71 | 1,919 | py | Python | test/Entry.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | test/Entry.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | test/Entry.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to us... | 29.523077 | 87 | 0.738927 |
__revision__ = "test/Entry.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', """
env = Environment(FOO = 'fff', BAR = 'bbb')
print Entry('ddd')
print Entry('$FOO')
print Entry('${BAR}_$BAR')
print env.Entry('ee... | true | true |
f719a19921e0717fd82f09f6ab40bd54a1718ceb | 18,564 | py | Python | sciencebeam_parser/models/model.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 13 | 2021-08-04T12:11:17.000Z | 2022-03-28T20:41:20.000Z | sciencebeam_parser/models/model.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 33 | 2021-08-05T08:37:59.000Z | 2022-03-29T18:42:09.000Z | sciencebeam_parser/models/model.py | elifesciences/sciencebeam-parser | 66964f283612b8d6fa8a23ad8790292c1ec07651 | [
"MIT"
] | 1 | 2022-01-05T14:53:06.000Z | 2022-01-05T14:53:06.000Z | import logging
from abc import ABC, abstractmethod
from collections import defaultdict
from dataclasses import dataclass, field
from typing import (
Callable,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
TypeVar,
Union
)
from sciencebeam_trainer_delft.se... | 37.053892 | 96 | 0.652823 | import logging
from abc import ABC, abstractmethod
from collections import defaultdict
from dataclasses import dataclass, field
from typing import (
Callable,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
TypeVar,
Union
)
from sciencebeam_trainer_delft.se... | true | true |
f719a28a0f454eca48dc84c19a7a003b8073c988 | 225 | py | Python | tests/test_case_files/class_test_1.py | calkerns/dyc | ddc35e6c183137dc30b2a3a2f481098280167bd1 | [
"MIT"
] | 100 | 2019-04-04T23:38:20.000Z | 2022-03-30T18:14:16.000Z | tests/test_case_files/class_test_1.py | calkerns/dyc | ddc35e6c183137dc30b2a3a2f481098280167bd1 | [
"MIT"
] | 51 | 2019-04-04T20:18:47.000Z | 2021-10-05T17:17:20.000Z | tests/test_case_files/class_test_1.py | calkerns/dyc | ddc35e6c183137dc30b2a3a2f481098280167bd1 | [
"MIT"
] | 63 | 2019-04-04T20:38:57.000Z | 2021-05-25T02:23:16.000Z | class MyClass:
x = 1
class MyClass1(Parent1):
y = 1
class MyClass2(Parent1, Parent2):
z = 1
class MyClass3(Parent1):
a = 1
class MyClass4(Parent1, Parent2):
b = 1
| 10.714286 | 41 | 0.515556 | class MyClass:
x = 1
class MyClass1(Parent1):
y = 1
class MyClass2(Parent1, Parent2):
z = 1
class MyClass3(Parent1):
a = 1
class MyClass4(Parent1, Parent2):
b = 1
| true | true |
f719a460ed4a51e9b13467d22b0a48aecf11f8ca | 346 | py | Python | students/k3343/laboratory_works/Rolinskiy_Sergey/Laba_1/project_first_app/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3343/laboratory_works/Rolinskiy_Sergey/Laba_1/project_first_app/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3343/laboratory_works/Rolinskiy_Sergey/Laba_1/project_first_app/urls.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | from django.urls import path
from django.conf.urls import url
from project_first_app.views import *
urlpatterns = [
path('',main,name='main'),
path('createowner/',createowner,name='createowner'),
path('login/',log_in,name='login'),
path(r'<int:ho_id>',review,name='detail')
]
#path(r'getowners/<int:ow_i... | 31.454545 | 56 | 0.699422 | from django.urls import path
from django.conf.urls import url
from project_first_app.views import *
urlpatterns = [
path('',main,name='main'),
path('createowner/',createowner,name='createowner'),
path('login/',log_in,name='login'),
path(r'<int:ho_id>',review,name='detail')
]
| true | true |
f719a465158b15ac1c1bfd62374aefc6ed61f38a | 36,465 | py | Python | owslib/iso.py | peterataylor/OWSLib | 8c15832da0c27dadfb567929ddd52a7570b7c231 | [
"BSD-3-Clause"
] | 1 | 2015-03-16T05:22:04.000Z | 2015-03-16T05:22:04.000Z | owslib/iso.py | peterataylor/OWSLib | 8c15832da0c27dadfb567929ddd52a7570b7c231 | [
"BSD-3-Clause"
] | null | null | null | owslib/iso.py | peterataylor/OWSLib | 8c15832da0c27dadfb567929ddd52a7570b7c231 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2009 Tom Kralidis
#
# Authors : Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Contact email: tomkralidis@gmail.com
# ================================... | 47.480469 | 225 | 0.604854 |
from owslib.etree import etree
from owslib import util
from owslib.namespaces import Namespaces
def get_namespaces():
n = Namespaces()
ns = n.get_namespaces(["gco","gmd","gml","gml32","gmx","gts","srv","xlink"])
ns[None] = n.get_namespace("gmd")
return ns
namespaces = get_namespaces()
cla... | true | true |
f719a47cc5a7d23e73cc98dbe3e60cc827cae0aa | 3,057 | py | Python | fun.py | Grymlock/Guardian_Bot | 0fac4cd37038a46d1d8b6eed3fbb79832bd7abf9 | [
"MIT"
] | 1 | 2018-06-22T03:52:49.000Z | 2018-06-22T03:52:49.000Z | fun.py | Grymlock/Guardian_Bot | 0fac4cd37038a46d1d8b6eed3fbb79832bd7abf9 | [
"MIT"
] | null | null | null | fun.py | Grymlock/Guardian_Bot | 0fac4cd37038a46d1d8b6eed3fbb79832bd7abf9 | [
"MIT"
] | null | null | null | import discord
import constants as c
from discord.ext import commands
import random as r
urls=['https://cdn.discordapp.com/attachments/433007901800398858/433047585121501194/maxresdefault.jpg','https://cdn.discordapp.com/attachments/442868510776098818/442879211296915466/9bt3n9w40bp01.jpg','https://cdn.discordapp.com... | 44.955882 | 391 | 0.615309 | import discord
import constants as c
from discord.ext import commands
import random as r
urls=['https://cdn.discordapp.com/attachments/433007901800398858/433047585121501194/maxresdefault.jpg','https://cdn.discordapp.com/attachments/442868510776098818/442879211296915466/9bt3n9w40bp01.jpg','https://cdn.discordapp.com... | true | true |
f719a5d3a4154a174de4fc3bb0bdc9ef6f49b521 | 1,012 | py | Python | test/schemes/test_qz.py | stormymcstorm/condensa | ee3bf993b0032e5d84aeb3cc7f0ddcdb8d846bd9 | [
"Apache-2.0"
] | 153 | 2019-05-29T15:10:38.000Z | 2022-03-05T05:20:55.000Z | test/schemes/test_qz.py | rogerxujiang/condensa | c7321e0a362f73eca9349769b341a7dd688ee1b9 | [
"Apache-2.0"
] | 5 | 2019-07-11T20:56:38.000Z | 2022-03-14T10:12:15.000Z | test/schemes/test_qz.py | rogerxujiang/condensa | c7321e0a362f73eca9349769b341a7dd688ee1b9 | [
"Apache-2.0"
] | 21 | 2019-05-30T22:21:54.000Z | 2022-03-14T07:06:52.000Z | # Copyright 2019 NVIDIA 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 applicable law or agreed to in wr... | 30.666667 | 74 | 0.733202 |
import torch
import condensa
from condensa import schemes
def test_float16(device):
scheme = schemes.Quantize(condensa.float16)
fc = torch.nn.Linear(100, 10).float().to(device)
scheme.pi(fc)
assert fc.weight.dtype == torch.float16
scheme.delta(fc)
assert fc.weight.dtype == torch... | true | true |
f719a5ec02915c2d40aa2c28ddf93147dd695082 | 6,791 | py | Python | objects/CSCG/_3d/forms/standard/base/export/field.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_3d/forms/standard/base/export/field.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_3d/forms/standard/base/export/field.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | """We want to export the field to some data files.
"""
from root.config.main import *
from screws.freeze.main import FrozenOnly
from screws.miscellaneous.timer import check_filename, check_no_splcharacter
from scipy.io import savemat
class _3dCSC_SF_Export_Field(FrozenOnly):
""""""
def __init__(self, sf):
... | 41.408537 | 103 | 0.472684 |
from root.config.main import *
from screws.freeze.main import FrozenOnly
from screws.miscellaneous.timer import check_filename, check_no_splcharacter
from scipy.io import savemat
class _3dCSC_SF_Export_Field(FrozenOnly):
def __init__(self, sf):
assert '3dCSCG_standard_form' in sf.standard_properties.ta... | true | true |
f719a60077cb4b23bbe3c54efafc1d30bc3f8163 | 3,252 | py | Python | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | 1 | 2019-03-13T16:05:11.000Z | 2019-03-13T16:05:11.000Z | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | null | null | null | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | 1 | 2019-03-15T09:09:08.000Z | 2019-03-15T09:09:08.000Z | from easydict import EasyDict as edict
# from pathlib import Path
import torch
import os
from torchvision import transforms as trans
from utils.constants import *
list_model = ['wget https://www.dropbox.com/s/akktsgxp0n8cwn2/model_mobilefacenet.pth?dl=0 -O model_mobilefacenet.pth',
'wget https://www.dropbox.com/s/kzo52... | 47.823529 | 119 | 0.634071 | from easydict import EasyDict as edict
import torch
import os
from torchvision import transforms as trans
from utils.constants import *
list_model = ['wget https://www.dropbox.com/s/akktsgxp0n8cwn2/model_mobilefacenet.pth?dl=0 -O model_mobilefacenet.pth',
'wget https://www.dropbox.com/s/kzo52d9neybjxsb/model_ir_se50.p... | true | true |
f719a616152547d0300a25992cdb6dbefb41b0a6 | 16,599 | py | Python | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | # Copyright 2019 Graphcore Ltd.
from statistics import mean
import numpy as np
import os
import re
import subprocess
import sys
import time
"""Library of utility functions common between frameworks"""
def parse_results_for_speed(output, iter_tolerance, speed_tolerance):
"""Look for <iter number> sec/itr. <speed... | 34.36646 | 85 | 0.636123 |
from statistics import mean
import numpy as np
import os
import re
import subprocess
import sys
import time
def parse_results_for_speed(output, iter_tolerance, speed_tolerance):
found_a_result = False
for line in output.split("\n"):
matches = re.match(r"([\d.]+) +sec/itr. +([\d.]+)", line)
... | true | true |
f719a788aa6769dc9f43b9f60b9a57cc0504643a | 1,535 | py | Python | code/clients/requests.py | lpmatos/gitlab-analytics | 47a220bb54efa473f01bf033291f65b38accdbca | [
"MIT"
] | 2 | 2020-09-16T11:03:01.000Z | 2021-07-30T07:05:58.000Z | code/clients/requests.py | lpmatos/gitlab-analytics | 47a220bb54efa473f01bf033291f65b38accdbca | [
"MIT"
] | null | null | null | code/clients/requests.py | lpmatos/gitlab-analytics | 47a220bb54efa473f01bf033291f65b38accdbca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import annotations
import requests
from validators.url import URL
from abc import ABC, abstractmethod
from requests.adapters import HTTPAdapter
from typing import Text, NoReturn, Callable, Dict
from requests.packages.urllib3.util.retry import Retry
class RequestResponse:
de... | 28.962264 | 130 | 0.704235 |
from __future__ import annotations
import requests
from validators.url import URL
from abc import ABC, abstractmethod
from requests.adapters import HTTPAdapter
from typing import Text, NoReturn, Callable, Dict
from requests.packages.urllib3.util.retry import Retry
class RequestResponse:
def __init__(self, respon... | true | true |
f719a9168a4d3106600fffcc47c14cc90f3cadc7 | 6,299 | py | Python | official/vision/detection/dataloader/tf_example_decoder.py | gujralsanyam22/models | d96f8f043dbe2b5ca8ea1785f57df8faf68d8875 | [
"Apache-2.0"
] | 153 | 2020-10-25T13:58:04.000Z | 2022-03-07T06:01:54.000Z | official/vision/detection/dataloader/tf_example_decoder.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 11 | 2020-07-13T08:29:00.000Z | 2022-03-24T07:21:09.000Z | official/vision/detection/dataloader/tf_example_decoder.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 23 | 2020-10-25T14:44:47.000Z | 2021-03-31T02:12:13.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... | 40.121019 | 122 | 0.657247 |
import tensorflow as tf
class TfExampleDecoder(object):
def __init__(self, include_mask=False):
self._include_mask = include_mask
self._keys_to_features = {
'image/encoded':
tf.io.FixedLenFeature((), tf.string),
'image/source_id':
tf.io.FixedLenFeature... | true | true |
f719a9bfc05dbb1ca8c4fffbbf92b7f387621266 | 859 | py | Python | taskobra/orm/components/cpu.py | Vipyr/taskobra | d9884f006ef9c735852075912d5a945543de52f5 | [
"MIT"
] | null | null | null | taskobra/orm/components/cpu.py | Vipyr/taskobra | d9884f006ef9c735852075912d5a945543de52f5 | [
"MIT"
] | 43 | 2020-02-06T22:23:42.000Z | 2020-04-29T23:56:43.000Z | taskobra/orm/components/cpu.py | Vipyr/taskobra | d9884f006ef9c735852075912d5a945543de52f5 | [
"MIT"
] | 2 | 2020-02-06T21:01:42.000Z | 2020-02-06T23:43:11.000Z | # Libraries
from sqlalchemy import Column, Float, ForeignKey, Integer, String
# Taskobra
from taskobra.orm.components import Component
class CPU(Component):
__tablename__ = "CPU"
unique_id = Column(Integer, ForeignKey("Component.unique_id"), primary_key=True)
manufacturer = Column(String)
model = Colu... | 29.62069 | 132 | 0.705471 |
from sqlalchemy import Column, Float, ForeignKey, Integer, String
from taskobra.orm.components import Component
class CPU(Component):
__tablename__ = "CPU"
unique_id = Column(Integer, ForeignKey("Component.unique_id"), primary_key=True)
manufacturer = Column(String)
model = Column(String)
isa = ... | true | true |
f719a9d668b8a403e901541f650b87db1bf30dbc | 1,112 | py | Python | music/migrations/0010_auto_20150427_2304.py | Amoki/Amoki-Music | 77b0e426fe9cc6c9cd12346a5e5e81a62362bb83 | [
"MIT"
] | 3 | 2015-06-16T11:12:29.000Z | 2019-05-03T09:09:21.000Z | music/migrations/0010_auto_20150427_2304.py | Amoki/Amoki-Music | 77b0e426fe9cc6c9cd12346a5e5e81a62362bb83 | [
"MIT"
] | 16 | 2015-08-18T14:35:55.000Z | 2021-06-10T17:31:04.000Z | music/migrations/0010_auto_20150427_2304.py | Amoki/Amoki-Music | 77b0e426fe9cc6c9cd12346a5e5e81a62362bb83 | [
"MIT"
] | 1 | 2016-10-19T14:48:52.000Z | 2016-10-19T14:48:52.000Z | from __future__ import unicode_literals
from django.db import models, migrations
def set_sources(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than this migration expects. We use the historical version.
Source = apps.get_model("music", "Source")
Temp... | 30.888889 | 92 | 0.654676 | from __future__ import unicode_literals
from django.db import models, migrations
def set_sources(apps, schema_editor):
# version than this migration expects. We use the historical version.
Source = apps.get_model("music", "Source")
TemporaryMusic = apps.get_model("music", "TemporaryMusic")
youtu... | true | true |
f719aae1c7a532a452c6a6c2a3522f59f033bbfa | 1,533 | py | Python | tests/test_fieldtype_model.py | MasterScott/Formasaurus | d7d916237a6d2ca4c80c4c8ae5d66999c8beebed | [
"MIT"
] | 132 | 2015-04-18T01:53:52.000Z | 2022-03-31T08:33:26.000Z | tests/test_fieldtype_model.py | Eglet27/Formasaurus | d7d916237a6d2ca4c80c4c8ae5d66999c8beebed | [
"MIT"
] | 26 | 2015-07-08T20:09:26.000Z | 2022-03-03T16:50:08.000Z | tests/test_fieldtype_model.py | Eglet27/Formasaurus | d7d916237a6d2ca4c80c4c8ae5d66999c8beebed | [
"MIT"
] | 63 | 2015-02-17T08:41:00.000Z | 2022-03-31T08:58:18.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import itertools
import numpy as np
from sklearn_crfsuite.metrics import flat_accuracy_score
from formasaurus.fieldtype_model import (
train,
_PRECISE_C1_C2,
_REALISTIC_C1_C2,
get_Xy,
)
def test_training(storage, capsys):
a... | 28.924528 | 65 | 0.701239 |
from __future__ import absolute_import, division
import itertools
import numpy as np
from sklearn_crfsuite.metrics import flat_accuracy_score
from formasaurus.fieldtype_model import (
train,
_PRECISE_C1_C2,
_REALISTIC_C1_C2,
get_Xy,
)
def test_training(storage, capsys):
annotations = (a for a i... | true | true |
f719ac12ab39a81ed2df4d9c929c5f6b2e9f5724 | 2,399 | py | Python | Lib/glyphsLib/__main__.py | silnrsi/glyphsLib | fc9ac286874e30130679430b028a173062c311a0 | [
"Apache-2.0"
] | 1 | 2019-01-19T05:50:30.000Z | 2019-01-19T05:50:30.000Z | Lib/glyphsLib/__main__.py | DalavanCloud/glyphsLib | fc9ac286874e30130679430b028a173062c311a0 | [
"Apache-2.0"
] | null | null | null | Lib/glyphsLib/__main__.py | DalavanCloud/glyphsLib | fc9ac286874e30130679430b028a173062c311a0 | [
"Apache-2.0"
] | 1 | 2019-01-19T05:50:14.000Z | 2019-01-19T05:50:14.000Z | # Copyright 2015 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... | 38.693548 | 82 | 0.631513 |
from __future__ import print_function, division, absolute_import, unicode_literals
import sys
import argparse
import glyphsLib
description = """\n
Converts a Glyphs.app source file into UFO masters
or UFO instances and MutatorMath designspace.
"""
def parse_options(args):
parser = argparse.Argum... | true | true |
f719ac201c882a4f33c304211ff792834b6fe5b0 | 640 | py | Python | fm2o2.py | dumpydog212/fm2o2 | b5e173735bb08466d6c20f7868725e627260dd88 | [
"MIT"
] | null | null | null | fm2o2.py | dumpydog212/fm2o2 | b5e173735bb08466d6c20f7868725e627260dd88 | [
"MIT"
] | null | null | null | fm2o2.py | dumpydog212/fm2o2 | b5e173735bb08466d6c20f7868725e627260dd88 | [
"MIT"
] | null | null | null | import glob
import os
from xml.dom import minidom
import xml.etree.ElementTree as ET
path = r"C:\Users\shamb\Desktop\dita_demo"
valid_path = r"C:\Users\shamb\Desktop\dita_demo_scrubbed"
wildcard = "*.xml"
full_path = os.path.join(path, wildcard)
os.makedirs(valid_path, exist_ok=True)
file_list = glob.glob(full_path... | 22.068966 | 57 | 0.696875 | import glob
import os
from xml.dom import minidom
import xml.etree.ElementTree as ET
path = r"C:\Users\shamb\Desktop\dita_demo"
valid_path = r"C:\Users\shamb\Desktop\dita_demo_scrubbed"
wildcard = "*.xml"
full_path = os.path.join(path, wildcard)
os.makedirs(valid_path, exist_ok=True)
file_list = glob.glob(full_path... | true | true |
f719acd0bf5519f70da4e2324dadedc8b1906093 | 12,049 | py | Python | gooddata-afm-client/gooddata_afm_client/model/included_dimension_props.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-24T16:27:06.000Z | 2022-02-25T10:18:49.000Z | gooddata-afm-client/gooddata_afm_client/model/included_dimension_props.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 29 | 2022-01-20T15:45:38.000Z | 2022-03-31T09:39:25.000Z | gooddata-afm-client/gooddata_afm_client/model/included_dimension_props.py | gooddata/gooddata-python-sdk | df4d4a4d730ab376960ae2ed01e7d86498e85c6a | [
"MIT"
] | 7 | 2022-01-20T07:11:15.000Z | 2022-03-09T14:50:17.000Z | """
OpenAPI definition
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v0
Contact: support@gooddata.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sy... | 45.813688 | 361 | 0.590256 |
import re
import sys
from gooddata_afm_client.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
... | true | true |
f719ad57e58a44fc929ef55ed10a1ee635466eb2 | 326 | py | Python | setup.py | droberin/cyberdyne-dyndns | 7d495390413cff2829f6b00a482f7b9dff3dcb5a | [
"MIT"
] | null | null | null | setup.py | droberin/cyberdyne-dyndns | 7d495390413cff2829f6b00a482f7b9dff3dcb5a | [
"MIT"
] | null | null | null | setup.py | droberin/cyberdyne-dyndns | 7d495390413cff2829f6b00a482f7b9dff3dcb5a | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='cyberdynedyndnscli',
version='0.1.0',
packages=['cyberdynedyndnscli'],
url='https://github.com/droberin/cyberdynedyndnscli',
license='MIT',
author='DRoBeR',
author_email='drober+software@gmail.com',
description='Cyberdyne.es Dynamic DNS clie... | 25.076923 | 57 | 0.699387 | from distutils.core import setup
setup(
name='cyberdynedyndnscli',
version='0.1.0',
packages=['cyberdynedyndnscli'],
url='https://github.com/droberin/cyberdynedyndnscli',
license='MIT',
author='DRoBeR',
author_email='drober+software@gmail.com',
description='Cyberdyne.es Dynamic DNS clie... | true | true |
f719ae112f660d822e36dfe8386ebed7cf3c5760 | 13,464 | py | Python | Doc/tools/extensions/pyspecific.py | deadsnakes/python3.4 | e8ac58ab083b57aa04b46c79f764c68bdab607a0 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Doc/tools/extensions/pyspecific.py | deadsnakes/python3.4 | e8ac58ab083b57aa04b46c79f764c68bdab607a0 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Doc/tools/extensions/pyspecific.py | deadsnakes/python3.4 | e8ac58ab083b57aa04b46c79f764c68bdab607a0 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pyspecific.py
~~~~~~~~~~~~~
Sphinx extension with Python doc-specific markup.
:copyright: 2008-2014 by Georg Brandl.
:license: Python license.
"""
import re
import codecs
from os import path
from time import asctime
from pprint import pformat
from docutils.io import St... | 36.096515 | 86 | 0.635844 |
import re
import codecs
from os import path
from time import asctime
from pprint import pformat
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document
from docutils import nodes, utils
from sphinx import addnodes
from sphinx.builders import Builder
fr... | true | true |
f719ae360e05e3d0b1462b0875f0af93d02276fd | 5,643 | py | Python | airflow/executors/debug_executor.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 3 | 2019-12-11T15:54:13.000Z | 2021-05-24T20:21:08.000Z | airflow/executors/debug_executor.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 8 | 2021-02-08T20:40:47.000Z | 2022-03-29T22:27:53.000Z | airflow/executors/debug_executor.py | IGIT-CN/airflow | a6e5bcd59198afe5716813e84ebc4c59eade532c | [
"Apache-2.0"
] | 2 | 2021-01-11T13:53:03.000Z | 2021-10-02T05:06:34.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.370861 | 104 | 0.633174 |
import threading
from typing import Any, Dict, List, Optional
from airflow.configuration import conf
from airflow.executors.base_executor import BaseExecutor
from airflow.models.taskinstance import TaskInstance, TaskInstanceKeyType
from airflow.utils.state import State
class DebugExecutor(BaseExecu... | true | true |
f719af5392c1befb33e7fc5a3df49b8e3154b0ce | 2,063 | py | Python | aliyun-python-sdk-eas/aliyunsdkeas/request/v20210701/ListServicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-eas/aliyunsdkeas/request/v20210701/ListServicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-eas/aliyunsdkeas/request/v20210701/ListServicesRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.746032 | 74 | 0.750848 |
from aliyunsdkcore.request import RoaRequest
from aliyunsdkeas.endpoint import endpoint_data
class ListServicesRequest(RoaRequest):
def __init__(self):
RoaRequest.__init__(self, 'eas', '2021-07-01', 'ListServices','eas')
self.set_uri_pattern('/api/v2/services')
self.set_method('GET')
if ... | true | true |
f719af5c196d30f0eb97eff99d60406c1d503639 | 1,912 | py | Python | tests/unit/recommenders/models/test_newsrec_utils.py | enowy/Recommenders | 60033231b9167438032843c23158c0c776856e0e | [
"MIT"
] | 10 | 2019-05-06T21:57:10.000Z | 2019-05-07T06:15:39.000Z | tests/unit/recommenders/models/test_newsrec_utils.py | enowy/Recommenders | 60033231b9167438032843c23158c0c776856e0e | [
"MIT"
] | 2 | 2022-01-19T20:24:51.000Z | 2022-02-18T20:25:24.000Z | tests/unit/recommenders/models/test_newsrec_utils.py | enowy/Recommenders | 60033231b9167438032843c23158c0c776856e0e | [
"MIT"
] | 3 | 2019-05-06T22:24:21.000Z | 2019-05-07T02:50:46.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import pytest
try:
from recommenders.models.deeprec.deeprec_utils import download_deeprec_resources
from recommenders.models.newsrec.newsrec_utils import prepare_hparams, load_yaml
except ImportError:
p... | 33.54386 | 88 | 0.69613 |
import os
import pytest
try:
from recommenders.models.deeprec.deeprec_utils import download_deeprec_resources
from recommenders.models.newsrec.newsrec_utils import prepare_hparams, load_yaml
except ImportError:
pass
@pytest.mark.parametrize(
"must_exist_attributes", ["wordEmb_file", "wordDict_fi... | true | true |
f719af7723defb10087e667c5753c6f31f956520 | 12,081 | py | Python | Self_Driving_Car/P1/LaneLines-P1/P1.py | Wentaobi/Udacity | 00af9c36b42d6bca5f2d42d2744efed2ddb51587 | [
"Apache-2.0"
] | null | null | null | Self_Driving_Car/P1/LaneLines-P1/P1.py | Wentaobi/Udacity | 00af9c36b42d6bca5f2d42d2744efed2ddb51587 | [
"Apache-2.0"
] | null | null | null | Self_Driving_Car/P1/LaneLines-P1/P1.py | Wentaobi/Udacity | 00af9c36b42d6bca5f2d42d2744efed2ddb51587 | [
"Apache-2.0"
] | null | null | null | #importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
#reading in an image
image = mpimg.imread('test_images/solidWhiteRight.jpg');
#printing out some stats and plotting
print('This image is:', type(image), 'with dimesions:', image.shape)
plt.im... | 35.848665 | 122 | 0.698121 |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
image = mpimg.imread('test_images/solidWhiteRight.jpg');
print('This image is:', type(image), 'with dimesions:', image.shape)
plt.imshow(image);
import math
def grayscale(img):
return cv2.cvtColor(img, cv2.COLOR_... | true | true |
f719afb71003662d81876c64edd582861d9f11a6 | 1,088 | py | Python | exercicios-Python/desaf045.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | exercicios-Python/desaf045.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | exercicios-Python/desaf045.py | marcelo-py/Exercicios-Python | d654d54821983897dbc377a2d3db97671dd75b5b | [
"MIT"
] | null | null | null | import random
from emoji import emojize
from time import sleep
itens = ('PEDRA', 'PAPEL', 'TESOURA')
print (emojize('''Suas opções:
[0] PEDRA :punch:
[1] PAPEL :hand:
[2] TESOURA :v:''',use_aliases=True))
escolha = int(input('Qual sua escolha? '))
computador = random.randint(0,2)
print('JO')
sleep(1)
print('KEN')
sleep... | 25.302326 | 59 | 0.607537 | import random
from emoji import emojize
from time import sleep
itens = ('PEDRA', 'PAPEL', 'TESOURA')
print (emojize('''Suas opções:
[0] PEDRA :punch:
[1] PAPEL :hand:
[2] TESOURA :v:''',use_aliases=True))
escolha = int(input('Qual sua escolha? '))
computador = random.randint(0,2)
print('JO')
sleep(1)
print('KEN')
sleep... | true | true |
f719afef6ce3f033481568e9522937db2bfbd069 | 86 | py | Python | my_exceptions.py | robert-dzikowski/api-smoke-test | 64394049ce82a0cf80fc128587a4a83e491725b7 | [
"MIT"
] | 1 | 2021-01-30T23:01:00.000Z | 2021-01-30T23:01:00.000Z | my_exceptions.py | robert-dzikowski/api-smoke-test | 64394049ce82a0cf80fc128587a4a83e491725b7 | [
"MIT"
] | null | null | null | my_exceptions.py | robert-dzikowski/api-smoke-test | 64394049ce82a0cf80fc128587a4a83e491725b7 | [
"MIT"
] | null | null | null | class TestFail(Exception):
"""
Exception raised when test has failed.
"""
| 17.2 | 42 | 0.627907 | class TestFail(Exception):
| true | true |
f719b0534049d456a9239569b20111fc6dcfa5fb | 292 | py | Python | esphome/components/json/__init__.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/components/json/__init__.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/components/json/__init__.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | import esphome.codegen as cg
from esphome.core import coroutine_with_priority
json_ns = cg.esphome_ns.namespace('json')
@coroutine_with_priority(1.0)
def to_code(config):
cg.add_library('ArduinoJson-esphomelib', '5.13.3')
cg.add_define('USE_JSON')
cg.add_global(json_ns.using)
| 24.333333 | 54 | 0.763699 | import esphome.codegen as cg
from esphome.core import coroutine_with_priority
json_ns = cg.esphome_ns.namespace('json')
@coroutine_with_priority(1.0)
def to_code(config):
cg.add_library('ArduinoJson-esphomelib', '5.13.3')
cg.add_define('USE_JSON')
cg.add_global(json_ns.using)
| true | true |
f719b0960e13ee24f7ce64d60d298220d2513dc0 | 53 | py | Python | shiftscheduler/gui/constants.py | c-rainbow/nurse-scheduling | 8537c875e46772700499a89dec3a30a796434fe0 | [
"MIT"
] | 2 | 2020-04-16T17:03:56.000Z | 2021-04-08T17:23:21.000Z | shiftscheduler/gui/constants.py | c-rainbow/nurse-scheduling | 8537c875e46772700499a89dec3a30a796434fe0 | [
"MIT"
] | null | null | null | shiftscheduler/gui/constants.py | c-rainbow/nurse-scheduling | 8537c875e46772700499a89dec3a30a796434fe0 | [
"MIT"
] | 1 | 2020-05-04T18:03:59.000Z | 2020-05-04T18:03:59.000Z |
EXCEL_FILE_TYPE = (("Excel 2007 files","*.xlsx"),) | 13.25 | 50 | 0.622642 |
EXCEL_FILE_TYPE = (("Excel 2007 files","*.xlsx"),) | true | true |
f719b09aaa3ce37ed804af7fc5327f4ef6a12908 | 645 | py | Python | noxfile.py | HarshNarayanJha/diddi-and-the-bugs | 82af417a2ab324de7bde38736bfc42430b6b46fa | [
"MIT"
] | null | null | null | noxfile.py | HarshNarayanJha/diddi-and-the-bugs | 82af417a2ab324de7bde38736bfc42430b6b46fa | [
"MIT"
] | null | null | null | noxfile.py | HarshNarayanJha/diddi-and-the-bugs | 82af417a2ab324de7bde38736bfc42430b6b46fa | [
"MIT"
] | null | null | null | """
I use Nox here to reformat the code.
"""
import nox
files = ["noxfile.py", "main.py", "setup.py"]
@nox.session(name="keep-codebase-clean")
def keep_codebase_clean(session):
"Run formatters."
session.install("-r", "test-requirements.txt")
session.run("isort", *files)
session.run("blac... | 26.875 | 59 | 0.632558 | import nox
files = ["noxfile.py", "main.py", "setup.py"]
@nox.session(name="keep-codebase-clean")
def keep_codebase_clean(session):
session.install("-r", "test-requirements.txt")
session.run("isort", *files)
session.run("black", *files)
@nox.session(name="check-quality")
def check_quality(... | true | true |
f719b22b9c5885616b30cc4050c5cf2de4e5b710 | 1,553 | py | Python | services/storage/tests/helpers/utils_assert.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | services/storage/tests/helpers/utils_assert.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | services/storage/tests/helpers/utils_assert.py | mrnicegyu11/osparc-simcore | b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | from pprint import pformat
from aiohttp import web
from servicelib.aiohttp.rest_responses import unwrap_envelope
async def assert_status(
response: web.Response, expected_cls: web.HTTPException, expected_msg: str = None
):
data, error = unwrap_envelope(await response.json())
assert (
response.st... | 28.759259 | 100 | 0.701223 | from pprint import pformat
from aiohttp import web
from servicelib.aiohttp.rest_responses import unwrap_envelope
async def assert_status(
response: web.Response, expected_cls: web.HTTPException, expected_msg: str = None
):
data, error = unwrap_envelope(await response.json())
assert (
response.st... | true | true |
f719b3cf4408be63834d8d778dce83c706005a42 | 2,919 | py | Python | python/src/ties/util/version.py | Noblis/ties-lib | e7c6165ebcd80e11b792fd4bcddf6ce634da0c60 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-10T19:02:27.000Z | 2020-04-10T19:02:27.000Z | python/src/ties/util/version.py | Noblis/ties-lib | e7c6165ebcd80e11b792fd4bcddf6ce634da0c60 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | python/src/ties/util/version.py | Noblis/ties-lib | e7c6165ebcd80e11b792fd4bcddf6ce634da0c60 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | ################################################################################
# Copyright 2019 Noblis, Inc #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... | 39.445946 | 84 | 0.528606 | true | true | |
f719b481bbf26bf74e10817f58f02d7b6a184525 | 905 | py | Python | packages/pyre/xml/ElementDescriptor.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/xml/ElementDescriptor.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/xml/ElementDescriptor.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
from .Descriptor import Descriptor
class ElementDescriptor(Descriptor):
"""
Descriptor class that gathers all the metadata about a document tag that was provided by
the user during the DTD declaration. It... | 25.857143 | 94 | 0.693923 |
from .Descriptor import Descriptor
class ElementDescriptor(Descriptor):
handler = None
attributes = ()
def __init__(self, *, tag, handler, root=False):
super().__init__(name=tag)
self.handler = handler
self.root = root
return
| true | true |
f719b4bd078cf626a5dea79e89509d44970085fe | 1,812 | py | Python | pliers/tests/extractors/api/test_clarifai_extractors.py | adelavega/pliers | dee21102689c77a56b7da48bf9a0ac10c90be0eb | [
"BSD-3-Clause"
] | null | null | null | pliers/tests/extractors/api/test_clarifai_extractors.py | adelavega/pliers | dee21102689c77a56b7da48bf9a0ac10c90be0eb | [
"BSD-3-Clause"
] | null | null | null | pliers/tests/extractors/api/test_clarifai_extractors.py | adelavega/pliers | dee21102689c77a56b7da48bf9a0ac10c90be0eb | [
"BSD-3-Clause"
] | null | null | null | from os.path import join
from ...utils import get_test_data_path
from pliers.extractors import ClarifaiAPIExtractor
from pliers.stimuli import ImageStim
from pliers.extractors.base import merge_results
import numpy as np
import pytest
@pytest.mark.skipif("'CLARIFAI_API_KEY' not in os.environ")
def test_clarifai_api_e... | 38.553191 | 75 | 0.711921 | from os.path import join
from ...utils import get_test_data_path
from pliers.extractors import ClarifaiAPIExtractor
from pliers.stimuli import ImageStim
from pliers.extractors.base import merge_results
import numpy as np
import pytest
@pytest.mark.skipif("'CLARIFAI_API_KEY' not in os.environ")
def test_clarifai_api_e... | true | true |
f719b4dc7ae13b6947c48e17f17fc0bd12e5e231 | 23,805 | py | Python | src/opendr/perception/object_tracking_2d/fair_mot/object_tracking_2d_fair_mot_learner.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 3 | 2021-06-24T01:54:25.000Z | 2021-12-12T16:21:24.000Z | src/opendr/perception/object_tracking_2d/fair_mot/object_tracking_2d_fair_mot_learner.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 79 | 2021-06-23T10:40:10.000Z | 2021-12-16T07:59:42.000Z | src/opendr/perception/object_tracking_2d/fair_mot/object_tracking_2d_fair_mot_learner.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 5 | 2021-07-04T07:38:50.000Z | 2021-12-12T16:18:47.000Z | # Copyright 2020-2021 OpenDR European Project
#
# 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 agree... | 34.650655 | 117 | 0.585003 |
import os
import json
import torch
import ntpath
import shutil
import numpy as np
import onnxruntime as ort
from torchvision.transforms import transforms as T
from opendr.engine.learners import Learner
from opendr.engine.datasets import DatasetIterator, ExternalDataset, MappedDatasetIterator
from opendr.p... | true | true |
f719b58aacd4b24349689985096bc6a158cb01c2 | 2,736 | py | Python | tests/crawler/media/test_bcc.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 1 | 2022-01-17T14:06:27.000Z | 2022-01-17T14:06:27.000Z | tests/crawler/media/test_bcc.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 9 | 2021-08-12T07:39:01.000Z | 2021-08-20T08:38:29.000Z | tests/crawler/media/test_bcc.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 1 | 2022-02-21T15:45:13.000Z | 2022-02-21T15:45:13.000Z | # encoding=utf-8
# Author: Yu-Lun Chiang
# Description: Test NewsCrawler
import logging
import pytest
from collections import namedtuple
from src.crawler.media import bcc
from src.utils.struct import NewsStruct
logger = logging.getLogger(__name__)
TEST_DATA = namedtuple(
typename="TEST_DATA",
field_names=[
... | 36 | 652 | 0.69883 |
import logging
import pytest
from collections import namedtuple
from src.crawler.media import bcc
from src.utils.struct import NewsStruct
logger = logging.getLogger(__name__)
TEST_DATA = namedtuple(
typename="TEST_DATA",
field_names=[
"name",
"link",
"expected_output",
],
)
T... | true | true |
f719b5a93057ca90d71d3ce08000892efc53327a | 659 | py | Python | 2-hard/following-integer/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 21 | 2015-02-09T18:41:15.000Z | 2021-07-31T02:43:28.000Z | 2-hard/following-integer/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | null | null | null | 2-hard/following-integer/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 37 | 2015-01-06T06:20:17.000Z | 2021-06-21T18:22:13.000Z | import sys
def get_digits_ignore_zero(x):
digits = {}
for digit in str(x):
if digit == '0':
continue
if digit in digits:
digits[digit] += 1
else:
digits[digit] = 1
return digits
def following_integer(x):
original_digits = get_digits_ignore_ze... | 21.966667 | 47 | 0.576631 | import sys
def get_digits_ignore_zero(x):
digits = {}
for digit in str(x):
if digit == '0':
continue
if digit in digits:
digits[digit] += 1
else:
digits[digit] = 1
return digits
def following_integer(x):
original_digits = get_digits_ignore_ze... | true | true |
f719b60f710335528b05a8c8cbb30e8033fe17df | 13,939 | py | Python | tests/base_test_class.py | uncycler/django-DefectDojo | d7523e1dc34af47185830c13bfa7aedfc667dd60 | [
"BSD-3-Clause"
] | 3 | 2020-10-27T08:58:03.000Z | 2021-04-28T14:20:16.000Z | tests/base_test_class.py | uncycler/django-DefectDojo | d7523e1dc34af47185830c13bfa7aedfc667dd60 | [
"BSD-3-Clause"
] | 82 | 2020-11-06T22:34:05.000Z | 2021-08-10T16:30:48.000Z | tests/base_test_class.py | uncycler/django-DefectDojo | d7523e1dc34af47185830c13bfa7aedfc667dd60 | [
"BSD-3-Clause"
] | 2 | 2022-02-07T09:57:28.000Z | 2022-03-11T08:42:59.000Z | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoAlertPresentException
import... | 43.423676 | 222 | 0.65801 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoAlertPresentException
import... | true | true |
f719b6cebef2b6af3c2533bfa679463c3243666f | 397 | py | Python | Code/Assignment/Assignment/asgi.py | vedez/SDEV2004 | b028c8454ddca9a1abeb95df95e7f189867dd346 | [
"MIT"
] | null | null | null | Code/Assignment/Assignment/asgi.py | vedez/SDEV2004 | b028c8454ddca9a1abeb95df95e7f189867dd346 | [
"MIT"
] | null | null | null | Code/Assignment/Assignment/asgi.py | vedez/SDEV2004 | b028c8454ddca9a1abeb95df95e7f189867dd346 | [
"MIT"
] | null | null | null | """
ASGI config for Assignment project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Assignment.settings')
application = get_asgi_application()
| true | true |
f719b6d868fa7d2ce1c38e9b3db6ae27ddd83ee7 | 1,459 | py | Python | python/vanitygen_onion.py | 5kyc0d3r/Junk | f95fc9beaaf5f234102e213bd977de51cafdcebe | [
"MIT"
] | null | null | null | python/vanitygen_onion.py | 5kyc0d3r/Junk | f95fc9beaaf5f234102e213bd977de51cafdcebe | [
"MIT"
] | null | null | null | python/vanitygen_onion.py | 5kyc0d3r/Junk | f95fc9beaaf5f234102e213bd977de51cafdcebe | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
MIT License
Copyright (c) 2017 5kyc0d3r
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... | 47.064516 | 103 | 0.797807 | true | true | |
f719b711c4580588d5faede2a699731e7e1104b7 | 73,903 | py | Python | src/sage/rings/derivation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/rings/derivation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/rings/derivation.py | sheerluck/sage | b5e572b7d231f70c139d9978d68add80c4ef353d | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | r"""
Derivations
Let `A` be a ring and `B` be an bimodule over `A`.
A derivation `d : A \to B` is an additive map that satisfies
the Leibniz rule
.. MATH::
d(xy) = x d(y) + d(x) y.
If `B` is an algebra over `A` and if we are given in addition a
ring homomorphism `\theta : A \to B`, a twisted derivation with res... | 31.663668 | 209 | 0.529153 |
from sage.structure.richcmp import op_EQ, op_NE
from sage.structure.unique_representation import UniqueRepresentation
from sage.sets.family import Family
from sage.modules.module import Module
from sage.structure.element import ModuleElement
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.... | true | true |
f719b7c6bd2479d28d7a6679e56b280ca817a0bb | 1,669 | py | Python | py/orbit/py_linac/overlapping_fields/jparc_enge_func_factory.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 17 | 2018-02-09T23:39:06.000Z | 2022-03-04T16:27:04.000Z | py/orbit/py_linac/overlapping_fields/jparc_enge_func_factory.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 22 | 2017-05-31T19:40:14.000Z | 2021-09-24T22:07:47.000Z | py/orbit/py_linac/overlapping_fields/jparc_enge_func_factory.py | LeoRya/py-orbit | 340b14b6fd041ed8ec2cc25b0821b85742aabe0c | [
"MIT"
] | 37 | 2016-12-08T19:39:35.000Z | 2022-02-11T19:59:34.000Z | #!/usr/bin/env python
#--------------------------------------------------------------
# This is a Enge Function Factory specific for the J-PARC. Some
# Enge's function parameters are defined by the aperture and length,
# and others are defined by the field distribution formula from Trace3D
# documentation.
#---------... | 34.061224 | 74 | 0.688436 |
# and others are defined by the field distribution formula from Trace3D
# documentation.
#--------------------------------------------------------------
import math
import sys
import os
from overlapping_quad_fields_lib import PMQ_Trace3D_Function
from overlapping_quad_fields_lib import EngeFunction
from overlapp... | true | true |
f719b9a65c9a3077b966cb0086383cf3d2d3c035 | 498 | py | Python | meiduo_mall/utils/secret.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | meiduo_mall/utils/secret.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | meiduo_mall/utils/secret.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | # 1.装包
# 2.导包
from django.conf import settings
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
# 3.实例化
# 4.加密解密
class SecretOauth(object):
# 加密
def dumps(self, data):
s = Serializer(secret_key=settings.SECRET_KEY, expires_in=3600)
result = s.dumps(data)
return re... | 21.652174 | 71 | 0.670683 |
from django.conf import settings
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
class SecretOauth(object):
def dumps(self, data):
s = Serializer(secret_key=settings.SECRET_KEY, expires_in=3600)
result = s.dumps(data)
return result.decode()
def loa... | true | true |
f719b9b7e40ad20e1eac164cd3eb7a2cf77da67a | 3,848 | py | Python | Phys_Seg/run.py | pedrob37/Phys_Seg | 7adc65d7b228b3a5702acfa9e6d0494d6b4c2dee | [
"Apache-2.0"
] | 1 | 2021-09-27T09:58:56.000Z | 2021-09-27T09:58:56.000Z | Phys_Seg/run.py | pedrob37/Phys_Seg | 7adc65d7b228b3a5702acfa9e6d0494d6b4c2dee | [
"Apache-2.0"
] | null | null | null | Phys_Seg/run.py | pedrob37/Phys_Seg | 7adc65d7b228b3a5702acfa9e6d0494d6b4c2dee | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import SimpleITK as sitk
from Phys_Seg.data_loading import load_and_preprocess, save_segmentation_nifti, read_file, save_img
from Phys_Seg.predict_case import predict_phys_seg, physics_preprocessing, image_preprocessing
import importlib
from Phys_Seg.utils import postprocess_prediction, ... | 38.09901 | 114 | 0.64527 | import torch
import numpy as np
import SimpleITK as sitk
from Phys_Seg.data_loading import load_and_preprocess, save_segmentation_nifti, read_file, save_img
from Phys_Seg.predict_case import predict_phys_seg, physics_preprocessing, image_preprocessing
import importlib
from Phys_Seg.utils import postprocess_prediction, ... | true | true |
f719bb906e369e26b721b5b82e53ff4644582d3b | 3,541 | py | Python | lzo_indexer/indexer.py | krux/python-lzo-indexer | 21fdd821a38d9b941c02036b7f30a15891311a7d | [
"Apache-2.0"
] | 8 | 2015-09-12T17:11:00.000Z | 2021-04-22T01:35:26.000Z | lzo_indexer/indexer.py | krux/python-lzo-indexer | 21fdd821a38d9b941c02036b7f30a15891311a7d | [
"Apache-2.0"
] | null | null | null | lzo_indexer/indexer.py | krux/python-lzo-indexer | 21fdd821a38d9b941c02036b7f30a15891311a7d | [
"Apache-2.0"
] | 4 | 2015-06-18T01:04:19.000Z | 2018-09-28T16:33:54.000Z | import struct
from collections import namedtuple
from StringIO import StringIO
# Magic string expected at the start of the file to verify it's LZO
_LZO_MAGIC = bytearray("\x89LZO\x00\r\n\x1a\n")
_COMPRESSION_CHECKSUMS = (0x02, 0x200) # ADLER32 CRC32
_DECOMPRESSION_CHECKSUMS = (0x01, 0x100) # ADLER32 CRC32
def _pa... | 29.508333 | 79 | 0.680316 | import struct
from collections import namedtuple
from StringIO import StringIO
_LZO_MAGIC = bytearray("\x89LZO\x00\r\n\x1a\n")
_COMPRESSION_CHECKSUMS = (0x02, 0x200) # ADLER32 CRC32
_DECOMPRESSION_CHECKSUMS = (0x01, 0x100) # ADLER32 CRC32
def _parse_header(lzo_file):
if lzo_file.tell() != 0:
raise E... | true | true |
f719bbd224fa1f348d74df1adf6270da318609b3 | 1,028 | py | Python | reference/ddtrace/ext/aws.py | stschenk/opentelemetry-python-contrib | 28c1331e571d386baab74f5028e3268e4bfda4cd | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | reference/ddtrace/ext/aws.py | stschenk/opentelemetry-python-contrib | 28c1331e571d386baab74f5028e3268e4bfda4cd | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-12-12T17:59:41.000Z | 2020-12-12T18:54:03.000Z | reference/ddtrace/ext/aws.py | stschenk/opentelemetry-python-contrib | 28c1331e571d386baab74f5028e3268e4bfda4cd | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-22T04:16:33.000Z | 2020-10-22T04:16:33.000Z | from ..utils.formats import flatten_dict
DENYLIST_ENDPOINT = ['kms', 'sts']
DENYLIST_ENDPOINT_TAGS = {
's3': ['params.Body'],
}
def truncate_arg_value(value, max_len=1024):
"""Truncate values which are bytes and greater than `max_len`.
Useful for parameters like 'Body' in `put_object` operations.
""... | 25.7 | 74 | 0.622568 | from ..utils.formats import flatten_dict
DENYLIST_ENDPOINT = ['kms', 'sts']
DENYLIST_ENDPOINT_TAGS = {
's3': ['params.Body'],
}
def truncate_arg_value(value, max_len=1024):
if isinstance(value, bytes) and len(value) > max_len:
return b'...'
return value
def add_span_arg_tags(span, endpoint_na... | true | true |
f719bbfb410401300cb793e160dd34ffe11f0df1 | 426 | py | Python | list_comprehensions.py | rjayasin/list-comprehension | 6937f4f6dec8b1b8722c31356db32de18795de8b | [
"MIT"
] | null | null | null | list_comprehensions.py | rjayasin/list-comprehension | 6937f4f6dec8b1b8722c31356db32de18795de8b | [
"MIT"
] | null | null | null | list_comprehensions.py | rjayasin/list-comprehension | 6937f4f6dec8b1b8722c31356db32de18795de8b | [
"MIT"
] | null | null | null | import math
#compute primes using list difference
#from http://www.secnetix.de/olli/Python/list_comprehensions.hawk
noprimes = [j for i in range(2, 8) for j in range(i*2, 50, i)]
difference = [x for x in range(2, 50) if x not in noprimes]
# print(difference)
#my own version, a little more complicated
primes = [x for ... | 35.5 | 105 | 0.692488 | import math
noprimes = [j for i in range(2, 8) for j in range(i*2, 50, i)]
difference = [x for x in range(2, 50) if x not in noprimes]
primes = [x for x in range(1, 51) if not any([y for y in range(2, int(math.sqrt(x) + 1)) if x % y == 0])]
| true | true |
f719bcfdda7fd95388f3a3f5283d672ebcdb37cb | 5,859 | py | Python | apps/translations/tests/test_helpers.py | Joergen/olympia | eb84203469adbb6584e50d7bb6f9de7f20980dac | [
"BSD-3-Clause"
] | 1 | 2015-10-29T06:55:20.000Z | 2015-10-29T06:55:20.000Z | apps/translations/tests/test_helpers.py | magopian/olympia | 70cad15111a89e3d5c715cbade8925b12d1b98dc | [
"BSD-3-Clause"
] | null | null | null | apps/translations/tests/test_helpers.py | magopian/olympia | 70cad15111a89e3d5c715cbade8925b12d1b98dc | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.utils import translation
import jingo
import pytest
from mock import Mock, patch
from nose.tools import eq_
import amo
import amo.tests
from addons.models import Addon
from translations import helpers
from translations.fields import save_signal
from translations.models imp... | 33.672414 | 79 | 0.635774 | from django.conf import settings
from django.utils import translation
import jingo
import pytest
from mock import Mock, patch
from nose.tools import eq_
import amo
import amo.tests
from addons.models import Addon
from translations import helpers
from translations.fields import save_signal
from translations.models imp... | true | true |
f719bd0e61d8fc8ee4756b2db46ad0dfa8dfa39d | 6,499 | py | Python | twisted/test/test_text.py | sxamit/twisted | 30f6966329c857c3631c60aeb420d84d7828e01e | [
"MIT",
"Unlicense"
] | 1 | 2017-08-07T14:52:02.000Z | 2017-08-07T14:52:02.000Z | Lib/site-packages/twisted/test/test_text.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/twisted/test/test_text.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.text}.
"""
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import text
sampleText = \
"""Every attempt to employ mathematical methods in the study of chemical
questions must ... | 26.744856 | 103 | 0.59086 |
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import text
sampleText = \
"""Every attempt to employ mathematical methods in the study of chemical
questions must be considered profoundly irrational and contrary to the
spirit of chemistry ... If mathematical analysis should... | true | true |
f719bed52604d78cd372c38b0ba41bc4f013d7b2 | 311 | py | Python | routes/show_bp.py | Silve1ra/fyyur | 580562cc592d587c9bed4f080b856664abb9f70d | [
"MIT"
] | 1 | 2021-09-17T11:56:38.000Z | 2021-09-17T11:56:38.000Z | routes/show_bp.py | Silve1ra/fyyur | 580562cc592d587c9bed4f080b856664abb9f70d | [
"MIT"
] | null | null | null | routes/show_bp.py | Silve1ra/fyyur | 580562cc592d587c9bed4f080b856664abb9f70d | [
"MIT"
] | null | null | null | from flask import Blueprint
from controllers.show import shows, create_shows, create_show_submission
show_bp = Blueprint('show_bp', __name__)
show_bp.route('/', methods=['GET'])(shows)
show_bp.route('/create', methods=['GET'])(create_shows)
show_bp.route('/create', methods=['POST'])(create_show_submission)
| 31.1 | 72 | 0.762058 | from flask import Blueprint
from controllers.show import shows, create_shows, create_show_submission
show_bp = Blueprint('show_bp', __name__)
show_bp.route('/', methods=['GET'])(shows)
show_bp.route('/create', methods=['GET'])(create_shows)
show_bp.route('/create', methods=['POST'])(create_show_submission)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.