hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70553d36267da3daf161458ce9a35ebf850e411 | 1,946 | py | Python | examples/functions/python3/mmlogic-simple/mmf.py | CodeLingoBot/open-match | 9c943d5a10b4d110a5dc8194ea3baffb4d4ddae0 | [
"Apache-2.0"
] | null | null | null | examples/functions/python3/mmlogic-simple/mmf.py | CodeLingoBot/open-match | 9c943d5a10b4d110a5dc8194ea3baffb4d4ddae0 | [
"Apache-2.0"
] | null | null | null | examples/functions/python3/mmlogic-simple/mmf.py | CodeLingoBot/open-match | 9c943d5a10b4d110a5dc8194ea3baffb4d4ddae0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
#Copyright 2018 Google LLC
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed... | 48.65 | 108 | 0.649024 |
import random
def makeMatches(profile_dict, player_pools):
| true | true |
f7055576cac41ce51631bbc57db651e00990eb63 | 4,019 | py | Python | zerver/lib/markdown/help_relative_links.py | moazzammoriani/zulip | ca506f71dc8b733827a6bf532b107291b4839e55 | [
"Apache-2.0"
] | null | null | null | zerver/lib/markdown/help_relative_links.py | moazzammoriani/zulip | ca506f71dc8b733827a6bf532b107291b4839e55 | [
"Apache-2.0"
] | null | null | null | zerver/lib/markdown/help_relative_links.py | moazzammoriani/zulip | ca506f71dc8b733827a6bf532b107291b4839e55 | [
"Apache-2.0"
] | null | null | null | import re
from typing import Any, List, Match, Optional
from markdown import Markdown
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from zerver.lib.markdown.preprocessor_priorities import PREPROCESSOR_PRIORITES
# There is a lot of duplicated code between this file and
# he... | 33.214876 | 97 | 0.629759 | import re
from typing import Any, List, Match, Optional
from markdown import Markdown
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from zerver.lib.markdown.preprocessor_priorities import PREPROCESSOR_PRIORITES
# it there as well.
REGEXP = re.compile(r"\{relative\|(?P<l... | true | true |
f7055739785c4cd04f80cc452e257c475ad0395d | 1,476 | py | Python | prova1/prova1.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | prova1/prova1.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | prova1/prova1.py | samcost/POO | 5c280407abb7aa9db1c82e52c34fd372465e8fe2 | [
"MIT"
] | null | null | null | import math
class Robo:
def __init__(self,nome):
self.__nome = nome
self.__posicao = [0.0,0.0]
self.__em_op = False
@property
def nome(self):
return self.__nome
@nome.setter
def nome(self, alterar_nome):
self.__nome = alterar_nome
@property
def... | 24.196721 | 109 | 0.592818 | import math
class Robo:
def __init__(self,nome):
self.__nome = nome
self.__posicao = [0.0,0.0]
self.__em_op = False
@property
def nome(self):
return self.__nome
@nome.setter
def nome(self, alterar_nome):
self.__nome = alterar_nome
@property
def... | true | true |
f70557ba49fa8bbd10988a5a6b0b41a89531538e | 13,690 | py | Python | lib/JumpScale/tools/codetools/CodeTools.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 8 | 2016-04-14T14:04:57.000Z | 2020-06-09T00:24:34.000Z | lib/JumpScale/tools/codetools/CodeTools.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 418 | 2016-01-25T10:30:00.000Z | 2021-09-08T12:29:13.000Z | lib/JumpScale/tools/codetools/CodeTools.py | Jumpscale/jumpscale_core8 | f80ac9b1ab99b833ee7adb17700dcf4ef35f3734 | [
"Apache-2.0"
] | 9 | 2016-04-21T07:21:17.000Z | 2022-01-24T10:35:54.000Z |
# from JumpScale.baselib.codeexecutor.CodeExecutor import CodeExecutor
import inspect
from JumpScale import j
from ClassBase import ClassBase, JSModelBase, JSRootModelBase
from TemplateEngineWrapper import TemplateEngineWrapper
from JumpScale.data.regex.RegexTools import RegexTools
from TextFileEditor import TextFile... | 36.801075 | 121 | 0.514171 |
import inspect
from JumpScale import j
from ClassBase import ClassBase, JSModelBase, JSRootModelBase
from TemplateEngineWrapper import TemplateEngineWrapper
from JumpScale.data.regex.RegexTools import RegexTools
from TextFileEditor import TextFileEditor
from WordReplacer import WordReplacer
def isPrimAttribute(o... | true | true |
f70557d356725dad83576aa76ea58678d0c0e049 | 1,921 | py | Python | tests/test_trim.py | jwilk/mwic | f3abc4bb35292e42603285f08a55336d04795ce7 | [
"MIT"
] | 38 | 2016-06-02T19:04:39.000Z | 2021-07-09T18:48:40.000Z | tests/test_trim.py | jwilk/mwic | f3abc4bb35292e42603285f08a55336d04795ce7 | [
"MIT"
] | 9 | 2016-05-26T13:31:11.000Z | 2022-02-07T20:40:11.000Z | tests/test_trim.py | jwilk/mwic | f3abc4bb35292e42603285f08a55336d04795ce7 | [
"MIT"
] | 7 | 2016-06-07T09:53:55.000Z | 2019-09-19T10:59:05.000Z | # Copyright © 2014-2016 Jakub Wilk <jwilk@jwilk.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the “Software”), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | 30.492063 | 79 | 0.647059 |
from nose.tools import (
assert_equal,
assert_greater_equal,
)
import lib.text as M
def test_ltrim():
def t(s, n, expected):
result = M.ltrim(s, n)
assert_greater_equal(
max(1, n),
len(result)
)
assert_equal(result, expected)
... | true | true |
f70559b1280ee06eb3bb7d227ddfef9d0d20fdfa | 876 | py | Python | google/colab/_import_hooks/__init__.py | Gauravds435/colabtools | 6b9972ff63689b30f1cc7dda06b0159d0e979c08 | [
"Apache-2.0"
] | 2 | 2020-10-15T14:59:34.000Z | 2021-02-19T15:25:01.000Z | google/colab/_import_hooks/__init__.py | Gauravds435/colabtools | 6b9972ff63689b30f1cc7dda06b0159d0e979c08 | [
"Apache-2.0"
] | null | null | null | google/colab/_import_hooks/__init__.py | Gauravds435/colabtools | 6b9972ff63689b30f1cc7dda06b0159d0e979c08 | [
"Apache-2.0"
] | 2 | 2020-10-12T05:45:32.000Z | 2020-10-12T11:09:59.000Z | # Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.086957 | 74 | 0.775114 |
from google.colab._import_hooks import _altair
from google.colab._import_hooks import _cv2
def _register_hooks():
_altair._register_hook()
_cv2._register_hook()
| true | true |
f7055a69708df947b5140370454fbcb299ec5cce | 6,460 | py | Python | spec/parsers_spec.py | gisce/esios | f90d89059847d1a7034c3cc7a5898a8409ce627f | [
"MIT"
] | 7 | 2016-02-25T11:20:18.000Z | 2022-03-07T20:01:36.000Z | spec/parsers_spec.py | gisce/esios | f90d89059847d1a7034c3cc7a5898a8409ce627f | [
"MIT"
] | 8 | 2017-02-28T14:50:52.000Z | 2022-01-27T16:58:05.000Z | spec/parsers_spec.py | gisce/esios | f90d89059847d1a7034c3cc7a5898a8409ce627f | [
"MIT"
] | 6 | 2016-03-18T14:43:14.000Z | 2022-01-12T13:04:09.000Z | # -*- coding: utf-8 -*-
from expects.testing import failure
from expects import *
from datetime import datetime
from dateutil.relativedelta import relativedelta
import json
import os
from esios import Esios
from esios.parsers import P48CierreParser
from pytz import timezone
LOCAL_TZ = timezone('Europe/Madrid')
UTC_... | 39.631902 | 130 | 0.576161 |
from expects.testing import failure
from expects import *
from datetime import datetime
from dateutil.relativedelta import relativedelta
import json
import os
from esios import Esios
from esios.parsers import P48CierreParser
from pytz import timezone
LOCAL_TZ = timezone('Europe/Madrid')
UTC_TZ = timezone('UTC')
... | true | true |
f7055c47f2348aba66bd852b9d2acd9572d37cb7 | 3,398 | py | Python | tareas/2/CorreaAlfredo/deGatosYRatones.py | FrancisBL5/sistop-2022-2 | 5c9c7363bbf2143b44b5886a9e6d51614218ffd8 | [
"CC-BY-4.0"
] | 9 | 2022-02-03T00:16:01.000Z | 2022-02-25T06:30:46.000Z | tareas/2/CorreaAlfredo/deGatosYRatones.py | FrancisBL5/sistop-2022-2 | 5c9c7363bbf2143b44b5886a9e6d51614218ffd8 | [
"CC-BY-4.0"
] | 27 | 2022-02-08T18:48:49.000Z | 2022-03-16T19:44:05.000Z | tareas/2/CorreaAlfredo/deGatosYRatones.py | FrancisBL5/sistop-2022-2 | 5c9c7363bbf2143b44b5886a9e6d51614218ffd8 | [
"CC-BY-4.0"
] | 31 | 2022-02-03T00:17:14.000Z | 2022-03-31T15:13:40.000Z | # -*- coding: utf-8 -*-
"""
Correa González Alfredo
De gatos y ratones
- Tengo k gatos (e I ratones) en casa.
- Les sirvo comida a mis gatos en m platos.
- Gatos y ratones han llegado a un acuerdo para repartirse el
tiempo y comida pero tienen que convencerme que están haciendo
su trabajo
- Los gatos pueden comer ... | 28.554622 | 93 | 0.604768 |
from threading import Semaphore, Thread, Event
import threading
import time
import random
hambreDeGato = 100
hambreDeRaton = 2
numeroDeGatos = 2
numeroDeRatones = 10
platos = []
p = 5
gatosComiendo = 0
ratonesComiendo = 0
mutex_hambreGato = threading.Semaphore(1)
mutex_hambreRaton = threading.Semaphore(1)
entrar_... | true | true |
f7055c54768f4c8845f7bfc40c698c57b626f1b2 | 3,204 | py | Python | Scripts/convert_png_tiles.py | TheOpponent/st3-translation-notes | c78d7c2347611c07677ec5e293bbd6351800f438 | [
"Unlicense"
] | null | null | null | Scripts/convert_png_tiles.py | TheOpponent/st3-translation-notes | c78d7c2347611c07677ec5e293bbd6351800f438 | [
"Unlicense"
] | 3 | 2022-03-27T17:05:09.000Z | 2022-03-31T13:45:59.000Z | Scripts/convert_png_tiles.py | TheOpponent/st3-translation-notes | c78d7c2347611c07677ec5e293bbd6351800f438 | [
"Unlicense"
] | null | null | null | # This script reads a PNG file containing a single row of 26 x 26 tiles and outputs binary data.
# NumPy and Pillow are required as dependencies.
#
# Specify an input PNG file and an optional output file as arguments.
# If an output file is not given, the binary data will be written in the console.
#
# The original gra... | 40.556962 | 133 | 0.634207 |
import struct
import sys
import numpy as np
from PIL import Image
def main():
if len(sys.argv) < 2:
print("Specify input PNG file.")
return
with Image.open(sys.argv[1]) as input_file:
output = b''
image = list(input_file.getdata(0))
image_... | true | true |
f7055f2933d1e39838b93296dc3c5e19f07f44fb | 9,876 | py | Python | tools/config.py | 0x53A/emscripten | dfb6fdadfd68b1478cda4654f55412552f7d8d09 | [
"MIT"
] | 1 | 2021-11-27T07:11:09.000Z | 2021-11-27T07:11:09.000Z | tools/config.py | thomasballinger/emscripten | c5928fec6e09f84872e9297806b44d828f1f0a05 | [
"MIT"
] | 1 | 2021-12-19T02:20:43.000Z | 2021-12-19T02:20:43.000Z | tools/config.py | thomasballinger/emscripten | c5928fec6e09f84872e9297806b44d828f1f0a05 | [
"MIT"
] | null | null | null | # Copyright 2020 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os
import sys
import logging
from .utils import path_from_root... | 34.17301 | 139 | 0.709093 |
import os
import sys
import logging
from .utils import path_from_root, exit_with_error, __rootpath__, which
logger = logging.getLogger('shared')
EMSCRIPTEN_ROOT = __rootpath__
NODE_JS = None
BINARYEN_ROOT = None
SPIDERMONKEY_ENGINE = None
V8_ENGINE = None
LLVM_ROOT = None
LLVM_ADD_VERSION = None
CLANG_ADD_VE... | true | true |
f7055f5a813d438b1a9eb2a7915b1bbd2c8e55ef | 678 | py | Python | redirink/users/models.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/users/models.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | null | null | null | redirink/users/models.py | Egor4ik325/redirink | 17ef85f48145ee6112f2fcbab60dcd9d65ba78bf | [
"MIT"
] | 1 | 2021-12-31T00:46:31.000Z | 2021-12-31T00:46:31.000Z | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
"""Default user for Redirink."""
#: First and last name do not cover name patterns around the globe
n... | 29.478261 | 74 | 0.682891 | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
name = CharField(_("Name of User"), blank=True, max_length=255)
first_name = None
last_name = ... | true | true |
f7056011dbb1ac21708cb6fd697c34c2e5888adc | 20,242 | py | Python | generate_eval_file.py | JRC1995/SocialMediaNER | 236b22ded48f64516ebf0577c3b9d9d907db84e0 | [
"MIT"
] | null | null | null | generate_eval_file.py | JRC1995/SocialMediaNER | 236b22ded48f64516ebf0577c3b9d9d907db84e0 | [
"MIT"
] | null | null | null | generate_eval_file.py | JRC1995/SocialMediaNER | 236b22ded48f64516ebf0577c3b9d9d907db84e0 | [
"MIT"
] | null | null | null | import numpy as np
import random
from dataLoader.batch import batcher
from transformers import BertTokenizerFast, ElectraTokenizerFast
from configs.WNUT_configs import *
from utils.ml_utils import *
from utils.data_utils import *
from utils.metric_utils import *
import argparse
from tqdm import tqdm
from pathlib import... | 35.953819 | 231 | 0.579636 | import numpy as np
import random
from dataLoader.batch import batcher
from transformers import BertTokenizerFast, ElectraTokenizerFast
from configs.WNUT_configs import *
from utils.ml_utils import *
from utils.data_utils import *
from utils.metric_utils import *
import argparse
from tqdm import tqdm
from pathlib import... | true | true |
f705601addf2dd2673cc05c4ac089334408efa43 | 2,220 | py | Python | dd_board_logger.py | jolibrain/dd_board | 0b7a0d152a278838ac95732b5925c95cc3fc9ee2 | [
"Apache-2.0"
] | 4 | 2017-09-11T13:46:26.000Z | 2019-12-11T11:01:10.000Z | dd_board_logger.py | jolibrain/dd_board | 0b7a0d152a278838ac95732b5925c95cc3fc9ee2 | [
"Apache-2.0"
] | 1 | 2017-09-11T13:46:21.000Z | 2017-09-11T13:46:21.000Z | dd_board_logger.py | jolibrain/dd_board | 0b7a0d152a278838ac95732b5925c95cc3fc9ee2 | [
"Apache-2.0"
] | 3 | 2017-09-20T13:08:31.000Z | 2020-07-17T05:50:59.000Z | # -*- coding:utf-8 -*-
import json, os
from shutil import rmtree
from datetime import datetime
from tensorboard_logger import configure as tbl_configure, log_value as tbl_log_value
class DDBoard:
"""Version 0.4
Converts logs to "TensorBoard compatible" data."""
# Default values
base_dir = "/opt/tensorboard/runs"... | 36.393443 | 227 | 0.679279 |
import json, os
from shutil import rmtree
from datetime import datetime
from tensorboard_logger import configure as tbl_configure, log_value as tbl_log_value
class DDBoard:
"""Version 0.4
Converts logs to "TensorBoard compatible" data."""
base_dir = "/opt/tensorboard/runs"
tensorboard
- sub_dir = string, ... | false | true |
f70561104782de2e235d4511bf0bf0b3283d5e1a | 323 | py | Python | exercises/play_ground/pg_022.py | EngineerToBe/python-labs | dbedcf1f8ebb4bdf756c732ad65c3b737df62cdf | [
"Apache-2.0"
] | null | null | null | exercises/play_ground/pg_022.py | EngineerToBe/python-labs | dbedcf1f8ebb4bdf756c732ad65c3b737df62cdf | [
"Apache-2.0"
] | null | null | null | exercises/play_ground/pg_022.py | EngineerToBe/python-labs | dbedcf1f8ebb4bdf756c732ad65c3b737df62cdf | [
"Apache-2.0"
] | null | null | null | # Create a function named more_than_n that has three parameters named lst, item, and n.
# The function should return True if item appears in the list more than n times. The function should return False otherwise.
def more_than_n(lst, item, n):
if lst.count(item) > n:
return True
else:
return Fa... | 40.375 | 124 | 0.71517 |
def more_than_n(lst, item, n):
if lst.count(item) > n:
return True
else:
return False | true | true |
f705622e5940a8d2588cb5974ea07bf217146809 | 20,749 | py | Python | PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 8 | 2020-03-20T23:18:36.000Z | 2020-05-27T11:00:06.000Z | PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
def applySubstructure( process, postfix="" ) :
task = getPatAlgosToolsTask(process)
from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
from PhysicsTools.Pat... | 66.717042 | 248 | 0.603644 | import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask, addToProcessAndTask
def applySubstructure( process, postfix="" ) :
task = getPatAlgosToolsTask(process)
from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
from PhysicsTools.Pat... | true | true |
f7056453a1c75203ba1b816e70ba850dc52f30e4 | 3,232 | py | Python | scripts/oldScripts2019/3_analyzeDataKnee_Participant1.py | oliviermirat/Scientizen | e06515acbdc2cc2dc22445489dec2df4af454920 | [
"MIT"
] | 3 | 2017-06-10T10:41:55.000Z | 2017-06-26T10:24:41.000Z | scripts/oldScripts2019/3_analyzeDataKnee_Participant1.py | oliviermirat/Scientizen | e06515acbdc2cc2dc22445489dec2df4af454920 | [
"MIT"
] | 56 | 2020-05-19T16:06:59.000Z | 2020-11-11T13:49:13.000Z | scripts/oldScripts2019/3_analyzeDataKnee_Participant1.py | oliviermirat/Scientizen | e06515acbdc2cc2dc22445489dec2df4af454920 | [
"MIT"
] | 12 | 2020-05-19T18:27:26.000Z | 2021-02-26T15:39:33.000Z | # This scripts assumes that the dataframe has been created and saved in data.txt
import pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addInsultIntensityColumns, getInsultAboveThreshold, getPainAboveThreshold, selectColumns,selectTime
from sklearn.preproce... | 35.911111 | 144 | 0.775062 |
import pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dataFrameUtilities import addInsultIntensityColumns, getInsultAboveThreshold, getPainAboveThreshold, selectColumns,selectTime
from sklearn.preprocessing import MinMaxScaler
input = open("../data/preprocessed/preprocessedData... | true | true |
f7056490fe820c5bc371a05eb7d52b47ad934ff3 | 146 | py | Python | boa/_version.py | duncanmmacleod/boa | 4a42cfd62b1e907c95737bb3079bbf626db62992 | [
"BSD-3-Clause"
] | 4 | 2020-05-27T15:58:36.000Z | 2020-05-28T20:50:42.000Z | boa/_version.py | wolfv/boa | a1be462ed015a47561c27c4e1ef4c0972095017d | [
"BSD-3-Clause"
] | null | null | null | boa/_version.py | wolfv/boa | a1be462ed015a47561c27c4e1ef4c0972095017d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2021, QuantStack
# SPDX-License-Identifier: BSD-3-Clause
version_info = (0, 7, 0)
__version__ = ".".join(map(str, version_info))
| 24.333333 | 46 | 0.705479 |
version_info = (0, 7, 0)
__version__ = ".".join(map(str, version_info))
| true | true |
f70564d7a09d116f125a022a0767e5a6e0d36386 | 3,260 | py | Python | api/tests/test_auth_emailactivation.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 1 | 2020-07-16T10:58:23.000Z | 2020-07-16T10:58:23.000Z | api/tests/test_auth_emailactivation.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 13 | 2018-11-30T02:29:39.000Z | 2022-03-11T23:35:49.000Z | api/tests/test_auth_emailactivation.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | null | null | null | from django.core.urlresolvers import resolve, reverse
from django.db import transaction
from django.test import TestCase
from django.test import Client
from django.utils import translation
from django.contrib.auth.models import User, Group
from django.contrib.auth import authenticate, login, logout
from rest_framework ... | 35.434783 | 83 | 0.68589 | from django.core.urlresolvers import resolve, reverse
from django.db import transaction
from django.test import TestCase
from django.test import Client
from django.utils import translation
from django.contrib.auth.models import User, Group
from django.contrib.auth import authenticate, login, logout
from rest_framework ... | true | true |
f70565606ba1ea85664abd157116b0df65dd6937 | 12,274 | py | Python | wagtail/wagtailembeds/oembed_providers.py | seddonym/wagtail-tableblock | aea3ce67a0800285b20b93018b7c0a8679e479b7 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailembeds/oembed_providers.py | seddonym/wagtail-tableblock | aea3ce67a0800285b20b93018b7c0a8679e479b7 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailembeds/oembed_providers.py | seddonym/wagtail-tableblock | aea3ce67a0800285b20b93018b7c0a8679e479b7 | [
"BSD-3-Clause"
] | null | null | null | OEMBED_ENDPOINTS = {
"https://speakerdeck.com/oembed.{format}": [
"^http(?:s)?://speakerdeck\\.com/.+$"
],
"https://alpha-api.app.net/oembed": [
"^http(?:s)?://alpha\\.app\\.net/[^#?/]+/post/.+$",
"^http(?:s)?://photos\\.app\\.net/[^#?/]+/.+$"
],
"http://www.youtube.com/oembe... | 37.420732 | 79 | 0.446309 | OEMBED_ENDPOINTS = {
"https://speakerdeck.com/oembed.{format}": [
"^http(?:s)?://speakerdeck\\.com/.+$"
],
"https://alpha-api.app.net/oembed": [
"^http(?:s)?://alpha\\.app\\.net/[^#?/]+/post/.+$",
"^http(?:s)?://photos\\.app\\.net/[^#?/]+/.+$"
],
"http://www.youtube.com/oembe... | true | true |
f70565f8f17d23fbb5f86778bb299941633d2717 | 41,785 | py | Python | discord/commands/commands.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | discord/commands/commands.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | discord/commands/commands.py | ThatGenZGamer48/Texus | 96cdee4544f3bbb873620ba7a8926d6f7dc5a672 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-2021 Pycord Development
Copyright (c) 2021-present Texus
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 restri... | 35.381033 | 110 | 0.612229 |
from __future__ import annotations
import asyncio
import types
import functools
import inspect
from collections import OrderedDict
from typing import Any, Callable, Dict, List, Optional, Union, TYPE_CHECKING
from ..enums import SlashCommandOptionType, ChannelType
from ..member import Member
from ..user import User
f... | true | true |
f70566c8c49314aaaa034de3b4b4298fd10bc138 | 95,527 | py | Python | test/orm/test_deprecations.py | edelooff/sqlalchemy | 97d2a2091ed4caee1e19168d0db39e4d94a6d12f | [
"MIT"
] | 1 | 2019-09-27T15:40:23.000Z | 2019-09-27T15:40:23.000Z | test/orm/test_deprecations.py | KonstantinKlepikov/sqlalchemy-1 | 2c34d2503a17316cae3282192405b9b9d60df6fe | [
"MIT"
] | null | null | null | test/orm/test_deprecations.py | KonstantinKlepikov/sqlalchemy-1 | 2c34d2503a17316cae3282192405b9b9d60df6fe | [
"MIT"
] | 1 | 2019-08-27T09:47:08.000Z | 2019-08-27T09:47:08.000Z | import sqlalchemy as sa
from sqlalchemy import and_
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import text
fr... | 32.066801 | 79 | 0.534435 | import sqlalchemy as sa
from sqlalchemy import and_
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy import text
fr... | true | true |
f70567387f4fdb0f240af2488067783b35be93ce | 1,196 | py | Python | tests/convert_softmax.py | juanCastrillo/gluon2pytorch | dc73055f0c74dbc45a70f21057fa161123826d86 | [
"MIT"
] | 73 | 2018-11-01T03:07:11.000Z | 2021-03-03T01:48:58.000Z | tests/convert_softmax.py | juanCastrillo/gluon2pytorch | dc73055f0c74dbc45a70f21057fa161123826d86 | [
"MIT"
] | 5 | 2018-11-02T06:45:33.000Z | 2019-09-24T06:54:59.000Z | tests/convert_softmax.py | juanCastrillo/gluon2pytorch | dc73055f0c74dbc45a70f21057fa161123826d86 | [
"MIT"
] | 5 | 2019-01-29T00:03:24.000Z | 2021-01-12T14:18:59.000Z | import torch
import mxnet as mx
import numpy as np
from gluon2pytorch import gluon2pytorch
class SoftmaxTest(mx.gluon.nn.HybridSequential):
def __init__(self):
super(SoftmaxTest, self).__init__()
from mxnet.gluon import nn
with self.name_scope():
self.conv1 = nn.Conv2D(3, 32)
... | 26 | 107 | 0.68311 | import torch
import mxnet as mx
import numpy as np
from gluon2pytorch import gluon2pytorch
class SoftmaxTest(mx.gluon.nn.HybridSequential):
def __init__(self):
super(SoftmaxTest, self).__init__()
from mxnet.gluon import nn
with self.name_scope():
self.conv1 = nn.Conv2D(3, 32)
... | true | true |
f705675ec8d1348ee1124a33b5cc7917d1404582 | 2,070 | py | Python | src.py/searchathing_unittest/core.py | devel0/SearchAThing.UnitTest | 186c5fe7ad55966c8e3db96e31d3c7110b4670e4 | [
"MIT"
] | null | null | null | src.py/searchathing_unittest/core.py | devel0/SearchAThing.UnitTest | 186c5fe7ad55966c8e3db96e31d3c7110b4670e4 | [
"MIT"
] | null | null | null | src.py/searchathing_unittest/core.py | devel0/SearchAThing.UnitTest | 186c5fe7ad55966c8e3db96e31d3c7110b4670e4 | [
"MIT"
] | null | null | null | """
* SearchAThing.UnitTest, Copyright(C) 2015-2017 Lorenzo Delana, License under MIT
*
* The MIT License(MIT)
* Copyright(c) 2015-2017 Lorenzo Delana, https://searchathing.com
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "So... | 40.588235 | 81 | 0.727536 |
import unittest
from searchathing_core.number import *
class Core(unittest.TestCase):
def test_equals_auto_tol(self):
self.assertTrue(equals_auto_tol(1, 1))
self.assertTrue(equals_auto_tol(1, 1 + 1e-20))
self.assertFalse(equals_auto_tol(1, 2))
self.assertTrue(equals_auto_tol(1, 2,... | true | true |
f70567bd7c6460781590f106e26647e5ae35ea3e | 7,280 | py | Python | cs15211/LetterCombinationsofaPhoneNumber.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2021-07-05T01:53:30.000Z | 2021-07-05T01:53:30.000Z | cs15211/LetterCombinationsofaPhoneNumber.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | null | null | null | cs15211/LetterCombinationsofaPhoneNumber.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2018-01-08T07:14:08.000Z | 2018-01-08T07:14:08.000Z | __source__ = 'https://leetcode.com/problems/letter-combinations-of-a-phone-number/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/letter-combinations-of-a-phone-number.py
# Time: O(n * 4^n)
# Space: O(n)
# Brute Force Search
#
# Description: Leetcode # 17. Letter Combinations of a Phone Number
#
# Given a ... | 32.070485 | 118 | 0.523352 | __source__ = 'https://leetcode.com/problems/letter-combinations-of-a-phone-number/'
olution:
def letterCombinations(self, digits):
if '' == digits: return []
kvmaps = {
'2': 'abc',
'3': 'def',
'4': 'ghi',
'5': 'jkl',
'6': 'mno',
... | false | true |
f70567d0c6ea41908433590f3fbf095df00bbd11 | 90,963 | py | Python | src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | r"""
Quiver mutation types
AUTHORS:
- Gregg Musiker (2012, initial version)
- Christian Stump (2012, initial version)
- Hugh Thomas (2012, initial version)
"""
#*****************************************************************************
# Copyright (C) 2011 Gregg Musiker <gmusiker@gmail.com>
# ... | 37.158088 | 161 | 0.486725 |
from __future__ import division, print_function
from __future__ import absolute_import
from six.moves import range
from sage.structure.sage_object import SageObject
from copy import copy
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.all import cached_method
from sage.ri... | true | true |
f7056a39294cfc2fe8aeb38f5ae59905c8a688b0 | 2,882 | py | Python | deps/dpdk/app/test/autotest.py | duk3luk3/MoonGen | c04e3e13a015ddd3cd26df41674024de449b5827 | [
"MIT"
] | 3 | 2017-04-05T01:57:32.000Z | 2021-04-01T02:22:12.000Z | deps/dpdk/app/test/autotest.py | duk3luk3/MoonGen | c04e3e13a015ddd3cd26df41674024de449b5827 | [
"MIT"
] | 1 | 2016-02-06T01:26:59.000Z | 2016-02-19T23:43:11.000Z | deps/dpdk/app/test/autotest.py | duk3luk3/MoonGen | c04e3e13a015ddd3cd26df41674024de449b5827 | [
"MIT"
] | 3 | 2015-11-29T08:10:00.000Z | 2018-10-29T09:22:42.000Z | #!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of sourc... | 34.722892 | 88 | 0.745316 |
import sys, autotest_data, autotest_runner
def usage():
print"Usage: autotest.py [test app|test iso image]",
print "[target] [whitelist|-blacklist]"
if len(sys.argv) < 3:
usage()
sys.exit(1)
target = sys.argv[2]
test_whitelist=None
test_blacklist=None
if len(sys.argv) > 3:... | false | true |
f7056ab25ad90481d8aa15bfd7dbc66c04b7c3ea | 4,314 | py | Python | backtrader/observers/benchmark.py | trinh-hoang-hiep/iching | e1feae5741c3cbde535d7a275b01d4f0cf9e21ed | [
"Apache-2.0"
] | 1 | 2021-04-09T06:24:08.000Z | 2021-04-09T06:24:08.000Z | backtrader/observers/benchmark.py | trinh-hoang-hiep/iching | e1feae5741c3cbde535d7a275b01d4f0cf9e21ed | [
"Apache-2.0"
] | null | null | null | backtrader/observers/benchmark.py | trinh-hoang-hiep/iching | e1feae5741c3cbde535d7a275b01d4f0cf9e21ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | 35.95 | 79 | 0.62077 | true | true | |
f7056c6430a204c2507a84847929823af3d8b505 | 8,334 | py | Python | autotest/test_gwf_lakobs01.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_lakobs01.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_lakobs01.py | mkennard-aquaveo/modflow6 | 73a0553636362c90f7d134318e1f5d902dbdc4d3 | [
"CC0-1.0"
] | null | null | null | # Test for checking lak observation input. The following observation types:
# 'lak', 'wetted-area', and 'conductance,' require that ID2 be provided when
# ID is an integer corresponding to a lake number and not BOUNDNAME.
# See table in LAK Package section of mf6io.pdf for an explanation of ID,
# ID2, and Observation ... | 24.952096 | 79 | 0.586273 |
import os
import pytest
import sys
import numpy as np
try:
import flopy
except:
msg = "Error. FloPy package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install flopy"
raise Exception(msg)
from framework import testing_framework
from simulation im... | true | true |
f7056da8b11d4e248ba6d5172376ce2589dd69a5 | 1,745 | py | Python | src/explore.py | argsim/argsim | e5407acf7e47f2bf517b0c580fcdee3654d31089 | [
"MIT"
] | null | null | null | src/explore.py | argsim/argsim | e5407acf7e47f2bf517b0c580fcdee3654d31089 | [
"MIT"
] | 2 | 2019-01-09T21:35:39.000Z | 2019-03-11T18:12:21.000Z | src/explore.py | argsim/argsim | e5407acf7e47f2bf517b0c580fcdee3654d31089 | [
"MIT"
] | null | null | null | import tensorflow as tf
from model import vAe, decode
import util_sp as sp
from util_io import load_txt
import numpy as np
def analyze(z, use_dim=[], seed=25):
''' z = np.array[2, dim], mu of two sentences'''
''' use_dim = list of int describing which dimension should be used '''
# select random path fr... | 29.083333 | 96 | 0.667049 | import tensorflow as tf
from model import vAe, decode
import util_sp as sp
from util_io import load_txt
import numpy as np
def analyze(z, use_dim=[], seed=25):
np.random.seed(seed)
if use_dim == []:
rdm_path = np.arange(len(z[0]))
else:
rdm_path = use_dim
np.random.shuffle(rdm_pa... | true | true |
f7056ed1da5c17a757cb1e9eff0dcc005ac50fbb | 40,250 | py | Python | venv/Lib/site-packages/caffe2/python/onnx/backend.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | 1 | 2020-02-24T06:23:07.000Z | 2020-02-24T06:23:07.000Z | venv/Lib/site-packages/caffe2/python/onnx/backend.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | 4 | 2021-06-02T00:49:27.000Z | 2022-01-13T01:59:34.000Z | venv/Lib/site-packages/caffe2/python/onnx/backend.py | countBMB/BenjiRepo | 79d882263baaf2a11654ca67d2e5593074d36dfa | [
"Apache-2.0"
] | null | null | null | ## @package onnx
# Module caffe2.python.onnx.backend
"""Backend for running ONNX on Caffe2
To run this, you will need to have Caffe2 installed as well.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
im... | 42.279412 | 346 | 0.602062 | e__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import collections
from subprocess import Popen, PIPE
import sys
import zipfile
import itertools
# vendored protobuf is loaded first. We can work around this by
# import... | true | true |
f7056f50f1feb79d81aa60f148cfd317c84f892f | 11,513 | py | Python | argocd_python_client/model/v1_event_list.py | RyanSiu1995/argocd-python-client | 2e8f097fe09f247a46ac70692241a93d1acd076a | [
"MIT"
] | 1 | 2021-11-20T13:37:43.000Z | 2021-11-20T13:37:43.000Z | argocd_python_client/model/v1_event_list.py | RyanSiu1995/argocd-python-client | 2e8f097fe09f247a46ac70692241a93d1acd076a | [
"MIT"
] | null | null | null | argocd_python_client/model/v1_event_list.py | RyanSiu1995/argocd-python-client | 2e8f097fe09f247a46ac70692241a93d1acd076a | [
"MIT"
] | null | null | null | """
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from argocd_python_client.model_utils import ( # noqa: F401
ApiTypeError,
Mo... | 42.958955 | 121 | 0.572136 |
import re
import sys
from argocd_python_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 |
f705700579504459d1022712175c926bb0c492e4 | 226 | py | Python | src/SimonGame.py | busvar/VuelingGame_Backend | 2be1afd85e1247dcc91ad23acec233bbf34b9d5f | [
"MIT"
] | null | null | null | src/SimonGame.py | busvar/VuelingGame_Backend | 2be1afd85e1247dcc91ad23acec233bbf34b9d5f | [
"MIT"
] | null | null | null | src/SimonGame.py | busvar/VuelingGame_Backend | 2be1afd85e1247dcc91ad23acec233bbf34b9d5f | [
"MIT"
] | null | null | null | from flask import Flask, request
import json
app = Flask(__name__)
@app.route('/')
def hello():
outFile = {'Tittle' : "Simon Game", 'msg' : "Hello World!"}
outFile = json.dumps(outFile)
return json.loads(outFile) | 22.6 | 63 | 0.659292 | from flask import Flask, request
import json
app = Flask(__name__)
@app.route('/')
def hello():
outFile = {'Tittle' : "Simon Game", 'msg' : "Hello World!"}
outFile = json.dumps(outFile)
return json.loads(outFile) | true | true |
f70570d4cfa7f238e84d553a1dc8710c1e1855b3 | 15,880 | py | Python | pru/db/geo/geo_operations.py | euctrl-pru/rt-python | da5d0040e250bd159845a0d43bf0b73eab368863 | [
"MIT"
] | null | null | null | pru/db/geo/geo_operations.py | euctrl-pru/rt-python | da5d0040e250bd159845a0d43bf0b73eab368863 | [
"MIT"
] | null | null | null | pru/db/geo/geo_operations.py | euctrl-pru/rt-python | da5d0040e250bd159845a0d43bf0b73eab368863 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2018 Via Technology Ltd. All Rights Reserved.
# Consult your license regarding permissions and restrictions.
#
"""
operations related to airspaces and intersections.
"""
from psycopg2 import Error, InternalError
from psycopg2.extensions import AsIs
from psycopg2.extras import DictCursor
from itertoo... | 42.573727 | 145 | 0.647922 |
from psycopg2 import Error, InternalError
from psycopg2.extensions import AsIs
from psycopg2.extras import DictCursor
from itertools import filterfalse
from functools import reduce
from shapely.wkt import loads
import pru.db.context as ctx
from pru.logger import logger
log = logger(__name__)
def make_point(lon... | true | true |
f70570d708510d481a042af8e412be25e905032d | 11,930 | py | Python | accel/cherry/tinygrad/ops_cherry.py | andreiaugustin/tinygrad | adaf17559564c75a35e901fc4f735c8cc46577d7 | [
"MIT"
] | 5,578 | 2020-10-18T16:26:28.000Z | 2022-03-31T18:31:04.000Z | accel/cherry/tinygrad/ops_cherry.py | JunnYu/tinygrad | c0c2c0b0414dec0862aa442c60e905f39958f572 | [
"MIT"
] | 219 | 2020-10-18T19:50:39.000Z | 2022-03-01T16:54:53.000Z | accel/cherry/tinygrad/ops_cherry.py | JunnYu/tinygrad | c0c2c0b0414dec0862aa442c60e905f39958f572 | [
"MIT"
] | 746 | 2020-10-18T20:09:37.000Z | 2022-03-30T10:11:46.000Z | import numpy as np
from tinygrad.tensor import Function
from extra.cherry import *
# ************* unary ops *************
class ReLU(Function):
def forward(ctx, input):
ctx.save_for_backward(input)
return cherry_unop(input, UnaryOps.RELU)
def backward(ctx, grad_output):
input, = ctx.saved_tensors
... | 39.766667 | 151 | 0.580553 | import numpy as np
from tinygrad.tensor import Function
from extra.cherry import *
class ReLU(Function):
def forward(ctx, input):
ctx.save_for_backward(input)
return cherry_unop(input, UnaryOps.RELU)
def backward(ctx, grad_output):
input, = ctx.saved_tensors
return cherry_binop(grad_output, cher... | true | true |
f705734671161b9c806e3992ccd70e77e6586843 | 3,536 | py | Python | scripts/e78.py | JackKelly/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 38 | 2015-08-14T14:38:52.000Z | 2021-12-15T03:21:04.000Z | scripts/e78.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | null | null | null | scripts/e78.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 26 | 2015-09-24T20:55:26.000Z | 2021-12-07T15:42:09.000Z | from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy
from lasagne.init import Uniform, Normal
from lasagne.layers import LSTMLayer, Dens... | 24.555556 | 92 | 0.633201 | from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import crossentropy
from lasagne.init import Uniform, Normal
from lasagne.layers import LSTMLayer, Dens... | true | true |
f70573dc0c48e48f0f19f0d85a70bb4837832aa3 | 278 | py | Python | tests/core/slashing/msgs_test.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | 24 | 2021-05-30T05:48:33.000Z | 2021-10-07T04:47:15.000Z | tests/core/slashing/msgs_test.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | 18 | 2021-05-30T09:05:26.000Z | 2021-10-17T07:12:12.000Z | tests/core/slashing/msgs_test.py | yeeyangtee/terra-sdk-python | 44e31290cfcb5563dd31a0d9c64c3ef2af72c0e2 | [
"MIT"
] | 10 | 2021-02-11T00:56:04.000Z | 2021-05-27T08:37:49.000Z | from terra_sdk.core.slashing import MsgUnjail
def test_deserializes_msg_unjail_examples(load_msg_examples):
examples = load_msg_examples(MsgUnjail.type, "./MsgUnjail.data.json")
for example in examples:
assert MsgUnjail.from_data(example).to_data() == example
| 34.75 | 73 | 0.780576 | from terra_sdk.core.slashing import MsgUnjail
def test_deserializes_msg_unjail_examples(load_msg_examples):
examples = load_msg_examples(MsgUnjail.type, "./MsgUnjail.data.json")
for example in examples:
assert MsgUnjail.from_data(example).to_data() == example
| true | true |
f7057425a1dbc05857f4d03d917ef320093bcace | 1,514 | py | Python | server/whistle_server/endpoints/login.py | Sailer43/Whistle | fff23638e60a3c9d5e3ed16016b47bf93df51088 | [
"MIT"
] | null | null | null | server/whistle_server/endpoints/login.py | Sailer43/Whistle | fff23638e60a3c9d5e3ed16016b47bf93df51088 | [
"MIT"
] | null | null | null | server/whistle_server/endpoints/login.py | Sailer43/Whistle | fff23638e60a3c9d5e3ed16016b47bf93df51088 | [
"MIT"
] | null | null | null | from flask_restful import abort, Resource
from flask import request, g, session
from flask.json import jsonify
from whistle_server.models.user import User
def verify_password(password, hashed):
from werkzeug.security import check_password_hash
return check_password_hash(hashed, password)
class LoginEndpoint(R... | 32.913043 | 68 | 0.619551 | from flask_restful import abort, Resource
from flask import request, g, session
from flask.json import jsonify
from whistle_server.models.user import User
def verify_password(password, hashed):
from werkzeug.security import check_password_hash
return check_password_hash(hashed, password)
class LoginEndpoint(R... | true | true |
f705746808871ddf968b20b0d702ff4053cdc8aa | 3,847 | py | Python | management/commands/cnntools_start_training.py | kovibalu/cnntools | 083dd35dbe006d794e61a88cc6e0935a0c0298ff | [
"MIT"
] | 1 | 2019-08-27T14:23:36.000Z | 2019-08-27T14:23:36.000Z | management/commands/cnntools_start_training.py | kovibalu/cnntools | 083dd35dbe006d794e61a88cc6e0935a0c0298ff | [
"MIT"
] | 1 | 2017-05-27T10:49:55.000Z | 2017-05-27T10:49:55.000Z | management/commands/cnntools_start_training.py | kovibalu/cnntools | 083dd35dbe006d794e61a88cc6e0935a0c0298ff | [
"MIT"
] | null | null | null | import json
import os
from optparse import make_option
from cnntools.models import CaffeCNN
from cnntools.tasks import schedule_training
from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = '<netid> <local?> <base_lr?> <weights?> <cpu?> <debug_info?> <desc?>'
help = 'Starts ... | 31.793388 | 97 | 0.523265 | import json
import os
from optparse import make_option
from cnntools.models import CaffeCNN
from cnntools.tasks import schedule_training
from django.core.management.base import BaseCommand
class Command(BaseCommand):
args = '<netid> <local?> <base_lr?> <weights?> <cpu?> <debug_info?> <desc?>'
help = 'Starts ... | false | true |
f70574814793b965d57be8421a905d367cb6d3c4 | 1,962 | py | Python | colour/models/tests/test_cam16_ucs.py | JGoldstone/colour | 6829b363d5f0682bff0f4826995e7ceac189ff28 | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cam16_ucs.py | JGoldstone/colour | 6829b363d5f0682bff0f4826995e7ceac189ff28 | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cam16_ucs.py | JGoldstone/colour | 6829b363d5f0682bff0f4826995e7ceac189ff28 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour.models.cam16_ucs` module.
"""
import unittest
from colour.models.tests.test_cam02_ucs import (
TestJMh_CIECAM02_to_UCS_Luo2006,
TestUCS_Luo2006_to_JMh_CIECAM02,
TestXYZ_to_UCS_Luo2006,
TestUCS_Luo2006_to_XYZ,
)
__author__ = 'Colo... | 25.815789 | 79 | 0.731397 |
import unittest
from colour.models.tests.test_cam02_ucs import (
TestJMh_CIECAM02_to_UCS_Luo2006,
TestUCS_Luo2006_to_JMh_CIECAM02,
TestXYZ_to_UCS_Luo2006,
TestUCS_Luo2006_to_XYZ,
)
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2021 - Colour Developers'
__license__ = 'New BSD L... | true | true |
f7057502a2b9e13dd28680ca2e93edeee96715c1 | 6,723 | py | Python | bindings/python/ensmallen_graph/datasets/string/dictyosteliumdiscoideum.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/dictyosteliumdiscoideum.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/dictyosteliumdiscoideum.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Dictyostelium discoideum.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 20... | 35.571429 | 223 | 0.70534 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def DictyosteliumDiscoideum(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f7057539fa1021d2f984df54ff3175f6e077ac81 | 8,191 | py | Python | starlette/staticfiles.py | krish-adi/starlette | 7c7ec5a7f72de360bafa938d14e2e1d6f4b6cb69 | [
"BSD-3-Clause"
] | 6,974 | 2018-06-25T13:56:49.000Z | 2022-03-31T21:33:04.000Z | starlette/staticfiles.py | krish-adi/starlette | 7c7ec5a7f72de360bafa938d14e2e1d6f4b6cb69 | [
"BSD-3-Clause"
] | 1,221 | 2018-06-25T15:31:07.000Z | 2022-03-31T09:14:59.000Z | starlette/staticfiles.py | krish-adi/starlette | 7c7ec5a7f72de360bafa938d14e2e1d6f4b6cb69 | [
"BSD-3-Clause"
] | 810 | 2018-06-25T16:07:52.000Z | 2022-03-30T16:34:12.000Z | import importlib.util
import os
import stat
import typing
from email.utils import parsedate
import anyio
from starlette.datastructures import URL, Headers
from starlette.exceptions import HTTPException
from starlette.responses import FileResponse, RedirectResponse, Response
from starlette.types import Receive, Scope,... | 35.154506 | 88 | 0.583201 | import importlib.util
import os
import stat
import typing
from email.utils import parsedate
import anyio
from starlette.datastructures import URL, Headers
from starlette.exceptions import HTTPException
from starlette.responses import FileResponse, RedirectResponse, Response
from starlette.types import Receive, Scope,... | true | true |
f705756c9c7aa72e798711682e387825c99eda61 | 25,822 | py | Python | barbican/plugin/interface/secret_store.py | lingxiankong/barbican | 2d2376397d01b26ac2d98c0e02b67dfa0ecc2b1c | [
"Apache-2.0"
] | null | null | null | barbican/plugin/interface/secret_store.py | lingxiankong/barbican | 2d2376397d01b26ac2d98c0e02b67dfa0ecc2b1c | [
"Apache-2.0"
] | null | null | null | barbican/plugin/interface/secret_store.py | lingxiankong/barbican | 2d2376397d01b26ac2d98c0e02b67dfa0ecc2b1c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | 38.482861 | 79 | 0.676594 |
import abc
from oslo_config import cfg
import six
from stevedore import named
from barbican.common import config
from barbican.common import exception
from barbican.common import utils
from barbican import i18n as u
from barbican.plugin.util import multiple_backends
from barbican.plugin.util import uti... | true | true |
f70575e6833962b86f0a0d3698e499eb7f481a7d | 7,605 | py | Python | stayclean-2019-january/update-google-chart.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 1 | 2020-01-13T13:03:48.000Z | 2020-01-13T13:03:48.000Z | stayclean-2019-january/update-google-chart.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | 2 | 2021-04-06T18:40:31.000Z | 2021-06-02T03:46:59.000Z | stayclean-2019-january/update-google-chart.py | foobarbazblarg/stayclean | 4cf78fd893edd7d493b7afdf9d1dc16416dc9d9d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
import datetime
from participantCollection import ParticipantCollection
# Edit Me!
participantFileNames =... | 57.180451 | 143 | 0.656016 |
spread
from oauth2client.client import SignedJwtAssertionCredentials
import datetime
from participantCollection import ParticipantCollection
participantFileNames = ['../stayclean-2014-november/participants.txt',
'../stayclean-2014-december/participants.txt',
'../stayc... | false | true |
f70576272db6e715ab91b4b6cd21f28a6e4e23c0 | 16,545 | py | Python | spirl/rl/components/agent.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/rl/components/agent.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/rl/components/agent.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import os
import torch
import torch.nn as nn
import numpy as np
from contextlib import contextmanager
from functools import partial
from torch.optim import Adam, SGD
from spirl.utils.general_utils import ParamDict, get_clipped_optimizer, AttrDict, prefix_dict, map_dict, \
nan_ho... | 48.236152 | 122 | 0.65065 | import os
import torch
import torch.nn as nn
import numpy as np
from contextlib import contextmanager
from functools import partial
from torch.optim import Adam, SGD
from spirl.utils.general_utils import ParamDict, get_clipped_optimizer, AttrDict, prefix_dict, map_dict, \
nan_ho... | true | true |
f70576f56e1dace795c9e93cbc74e95d6940c629 | 9,236 | py | Python | bot/core/conversation.py | lugodev/telegram-pocket-bot | ae9cbfc1aa14c3bd8dd292c477f69891d82d9d94 | [
"MIT"
] | 1 | 2021-11-12T04:08:35.000Z | 2021-11-12T04:08:35.000Z | bot/core/conversation.py | lugodev/telegram-pocket-bot | ae9cbfc1aa14c3bd8dd292c477f69891d82d9d94 | [
"MIT"
] | null | null | null | bot/core/conversation.py | lugodev/telegram-pocket-bot | ae9cbfc1aa14c3bd8dd292c477f69891d82d9d94 | [
"MIT"
] | null | null | null | import time
import emoji
from telegram import InlineKeyboardMarkup, ParseMode, InlineKeyboardButton
from telegram.ext import run_async, ConversationHandler
from telegram.error import TelegramError
from django.db.models import Q
from . import constants, authentication, renderers, models
def send_broadcast(admin, broad... | 24.962162 | 90 | 0.581637 | import time
import emoji
from telegram import InlineKeyboardMarkup, ParseMode, InlineKeyboardButton
from telegram.ext import run_async, ConversationHandler
from telegram.error import TelegramError
from django.db.models import Q
from . import constants, authentication, renderers, models
def send_broadcast(admin, broad... | true | true |
f705779e537fd0636da37fcab248e0fca545bfc5 | 10,249 | py | Python | elasticapm/contrib/django/client.py | haider-zada96/apm_test | fa16fc30a055625abcde287073822cdbe979846c | [
"BSD-3-Clause"
] | 2 | 2019-02-15T20:23:39.000Z | 2019-02-15T20:26:06.000Z | elasticapm/contrib/django/client.py | haider-zada96/apm_test | fa16fc30a055625abcde287073822cdbe979846c | [
"BSD-3-Clause"
] | null | null | null | elasticapm/contrib/django/client.py | haider-zada96/apm_test | fa16fc30a055625abcde287073822cdbe979846c | [
"BSD-3-Clause"
] | null | null | null | """
elasticapm.contrib.django.client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011-2017 Elasticsearch
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import django
fr... | 36.088028 | 110 | 0.621524 |
from __future__ import absolute_import
import logging
import django
from django.conf import settings as django_settings
from django.core.exceptions import DisallowedHost
from django.db import DatabaseError
from django.http import HttpRequest
from elasticapm.base import Client
from elasticapm.conf import constants
f... | true | true |
f705783686a1d9d13021c5a0cc244a45478a4753 | 932 | py | Python | setup.py | abhijitbendale/rls-lab | dedff01b9af01e06d0d6cd52df5532361cd893b1 | [
"BSD-4-Clause"
] | null | null | null | setup.py | abhijitbendale/rls-lab | dedff01b9af01e06d0d6cd52df5532361cd893b1 | [
"BSD-4-Clause"
] | null | null | null | setup.py | abhijitbendale/rls-lab | dedff01b9af01e06d0d6cd52df5532361cd893b1 | [
"BSD-4-Clause"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup, Extension
import glob
import os
# Get matfiles and images for testing
matfi... | 34.518519 | 208 | 0.531116 |
from distutils.core import setup, Extension
import glob
import os
matfiles=glob.glob(os.path.join('tests/data/*.mat'))
data=glob.glob(os.path.join('data/*'))
setup(
name='RLS',
version='1.0',
description='Python implementation of RLS program',
author='Abhijit Bendale',
author_email='bendale@mi... | true | true |
f705792361b745c5f11279f9c6b12a22432ba982 | 24,888 | py | Python | alipay/aop/api/domain/ExSourceRateVO.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ExSourceRateVO.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/ExSourceRateVO.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class ExSourceRateVO(object):
def __init__(self):
self._bid = None
self._currency_pair = None
self._currency_unit = None
self._expiry_time = None
s... | 34.046512 | 95 | 0.600932 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class ExSourceRateVO(object):
def __init__(self):
self._bid = None
self._currency_pair = None
self._currency_unit = None
self._expiry_time = None
self._extended_params = None
self._ge... | true | true |
f70579f8510e28a077bbf6b0f660e6af3d650613 | 2,017 | py | Python | src/scs_dev/disk_volume.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 2 | 2017-04-24T14:58:28.000Z | 2020-05-27T08:53:46.000Z | src/scs_dev/disk_volume.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 1 | 2020-07-13T14:33:59.000Z | 2021-03-27T08:52:04.000Z | src/scs_dev/disk_volume.py | south-coast-science/scs_dev | b746adda020498b911cb92f28d4f07b14df996a2 | [
"MIT"
] | 1 | 2018-08-24T09:55:01.000Z | 2018-08-24T09:55:01.000Z | #!/usr/bin/env python3
"""
Created on 15 Oct 2020
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
DESCRIPTION
The disk_volume utility is used to determine whether a volume is mounted and, if so, the free and used space on
the volume. Space is given in blocks. The volume is identified by its mount point.
... | 28.814286 | 118 | 0.55181 |
import sys
from scs_core.data.json import JSONify
from scs_dev.cmd.cmd_disk_volume import CmdDiskVolume
from scs_host.sys.host import Host
if __name__ == '__main__':
cmd = CmdDiskVolume()
if not cmd.is_valid():
cmd.print_help(sys.stderr)
exit(2)
if cmd.verbose:
... | true | true |
f7057aba528eede039765622b679f775d7e03025 | 1,685 | py | Python | nova/tests/virt/test_images.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:22.000Z | 2015-11-25T10:18:22.000Z | nova/tests/virt/test_images.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/tests/virt/test_images.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Copyright 2013 IBM Corp.
#
# 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... | 37.444444 | 78 | 0.67003 |
import os
import mock
from nova import exception
from nova.openstack.common import processutils
from nova import test
from nova import utils
from nova.virt import images
class QemuTestCase(test.NoDBTestCase):
def test_qemu_info_with_bad_path(self):
self.assertRaises(exception.InvalidDiskIn... | true | true |
f7057b8575bc4fd7fcbfbdc13379515dfc6d8dfe | 635 | py | Python | crawler/edge_image.py | Znmangosteen/cgan-face-generator | cb2912ad6dd3971af238a83e8d56fb3a43082893 | [
"BSD-3-Clause"
] | 59 | 2017-10-15T03:59:06.000Z | 2022-02-27T00:23:12.000Z | crawler/edge_image.py | Znmangosteen/cgan-face-generator | cb2912ad6dd3971af238a83e8d56fb3a43082893 | [
"BSD-3-Clause"
] | 1 | 2019-08-27T09:05:26.000Z | 2019-08-27T09:05:26.000Z | crawler/edge_image.py | Znmangosteen/cgan-face-generator | cb2912ad6dd3971af238a83e8d56fb3a43082893 | [
"BSD-3-Clause"
] | 11 | 2017-12-15T18:23:29.000Z | 2021-05-23T20:01:31.000Z | import cv2
import argparse
import numpy as np
def process_edge_image(input, output):
print('edge', input, output)
img = cv2.imread(input)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.GaussianBlur(img, (3, 3), 0)
ret, thr = cv2.threshold(img, 0, 255, cv2.THRESH_OTSU)
edges = cv2.Cann... | 27.608696 | 58 | 0.67874 | import cv2
import argparse
import numpy as np
def process_edge_image(input, output):
print('edge', input, output)
img = cv2.imread(input)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.GaussianBlur(img, (3, 3), 0)
ret, thr = cv2.threshold(img, 0, 255, cv2.THRESH_OTSU)
edges = cv2.Cann... | true | true |
f7057d00a3ca443859a829101edfeaf4bf72956b | 2,962 | py | Python | src/config.py | sopuli/reporanka | a06994e23675f8de50fa878c532660532d14648c | [
"MIT"
] | 3 | 2021-11-24T15:39:36.000Z | 2021-11-25T19:32:07.000Z | src/config.py | sopuli/reporanka | a06994e23675f8de50fa878c532660532d14648c | [
"MIT"
] | 12 | 2021-11-27T07:55:20.000Z | 2021-12-12T23:56:23.000Z | src/config.py | sopuli/reporanka | a06994e23675f8de50fa878c532660532d14648c | [
"MIT"
] | 2 | 2021-11-26T14:16:34.000Z | 2021-12-10T15:30:13.000Z | """Module for specifying the environmental variables."""
import os
DIRNAME = os.path.dirname(__file__)
DB_NAME = "items.csv"
DB_PATH = os.path.join(DIRNAME, "data", DB_NAME)
TEST_DB = "test_items.csv"
TEST_DB_PATH = os.path.join(DIRNAME, "data", TEST_DB)
INSTRUCTIONS = (
"\nValitse toiminto"
"\n (1) lisää"
... | 35.686747 | 93 | 0.595881 | import os
DIRNAME = os.path.dirname(__file__)
DB_NAME = "items.csv"
DB_PATH = os.path.join(DIRNAME, "data", DB_NAME)
TEST_DB = "test_items.csv"
TEST_DB_PATH = os.path.join(DIRNAME, "data", TEST_DB)
INSTRUCTIONS = (
"\nValitse toiminto"
"\n (1) lisää"
"\n (2) listaa"
"\n (3) poista"
"\n (4) hae t... | true | true |
f7057e752fa60f9a70ee24a03a508261e1d4ed2f | 19,887 | py | Python | hummingbot/client/hummingbot_application.py | Loopring/hummingbot-deprecated | 43be8574ed9efd405aeee13a34c7a87ee732c7aa | [
"Apache-2.0"
] | null | null | null | hummingbot/client/hummingbot_application.py | Loopring/hummingbot-deprecated | 43be8574ed9efd405aeee13a34c7a87ee732c7aa | [
"Apache-2.0"
] | null | null | null | hummingbot/client/hummingbot_application.py | Loopring/hummingbot-deprecated | 43be8574ed9efd405aeee13a34c7a87ee732c7aa | [
"Apache-2.0"
] | 1 | 2021-11-23T19:59:17.000Z | 2021-11-23T19:59:17.000Z | #!/usr/bin/env python
import asyncio
from collections import deque
import logging
import time
from typing import List, Dict, Optional, Tuple, Set, Deque
from hummingbot.client.command import __all__ as commands
from hummingbot.core.clock import Clock
from hummingbot.core.data_type.order_book_tracker import OrderBookT... | 50.603053 | 154 | 0.654196 |
import asyncio
from collections import deque
import logging
import time
from typing import List, Dict, Optional, Tuple, Set, Deque
from hummingbot.client.command import __all__ as commands
from hummingbot.core.clock import Clock
from hummingbot.core.data_type.order_book_tracker import OrderBookTrackerDataSourceType
... | true | true |
f7057f4bf2418d7e4f54b2e0e6f937362a8f09bc | 4,381 | py | Python | faassupervisor/faas/binary/supervisor.py | grycap/faas-supervisor | f5dcb6a16cadec53235c13278942567947c7b443 | [
"Apache-2.0"
] | 7 | 2019-03-14T15:18:54.000Z | 2022-01-13T07:37:18.000Z | faassupervisor/faas/binary/supervisor.py | grycap/faas-supervisor | f5dcb6a16cadec53235c13278942567947c7b443 | [
"Apache-2.0"
] | 2 | 2019-10-14T09:50:57.000Z | 2020-01-08T11:25:54.000Z | faassupervisor/faas/binary/supervisor.py | grycap/faas-supervisor | f5dcb6a16cadec53235c13278942567947c7b443 | [
"Apache-2.0"
] | 8 | 2019-04-02T16:48:46.000Z | 2022-01-28T13:45:49.000Z | # Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 45.635417 | 88 | 0.624515 |
import subprocess
import sys
import uuid
from faassupervisor.faas import DefaultSupervisor
from faassupervisor.logger import get_logger
from faassupervisor.utils import SysUtils, FileUtils, StrUtils
class BinarySupervisor(DefaultSupervisor):
_SCRIPT_FILE_NAME = 'script.sh'
_OSCAR_SCRIPT_PATH = ... | true | true |
f7057fd5afafd3865f8482c22c4d763876ca6411 | 8,749 | py | Python | src/main.py | Alamgir-K/Climate-Change-Simulation | 2928ad1522d0371885dbd174ef14e5795e6282d2 | [
"MIT"
] | null | null | null | src/main.py | Alamgir-K/Climate-Change-Simulation | 2928ad1522d0371885dbd174ef14e5795e6282d2 | [
"MIT"
] | null | null | null | src/main.py | Alamgir-K/Climate-Change-Simulation | 2928ad1522d0371885dbd174ef14e5795e6282d2 | [
"MIT"
] | null | null | null | """
Climate Change Project
"""
import plotly.graph_objects as go
from PIL import Image, ImageDraw, ImageFont
from computing_data import calc_high_actual_pd, \
calc_low_actual_pd, \
calc_median_actual_pd, \
make_high_rcp_list, make_low_rcp_list, \
make_median_rcp_list, rcp_to_slice, temp_to_rgb
from read... | 42.470874 | 98 | 0.572865 | import plotly.graph_objects as go
from PIL import Image, ImageDraw, ImageFont
from computing_data import calc_high_actual_pd, \
calc_low_actual_pd, \
calc_median_actual_pd, \
make_high_rcp_list, make_low_rcp_list, \
make_median_rcp_list, rcp_to_slice, temp_to_rgb
from reading_data import read_actual_dat... | true | true |
f705805a5a9535dbea10b25388e800f47b46988d | 1,937 | py | Python | pyscf/nao/tddft_iter_x_zip.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 3 | 2021-02-28T00:52:53.000Z | 2021-03-01T06:23:33.000Z | pyscf/nao/tddft_iter_x_zip.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/nao/tddft_iter_x_zip.py | robert-anderson/pyscf | cdc56e168cb15f47e8cdc791a92d689fa9b655af | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | from __future__ import print_function, division
from numpy import array, argmax
from pyscf.nao import tddft_iter
class tddft_iter_x_zip(tddft_iter):
""" Iterative TDDFT with a high-energy part of the KS eigenvectors compressed """
def __init__(self, **kw):
from pyscf.nao.m_fermi_dirac import fermi_dirac_occu... | 42.108696 | 109 | 0.669592 | from __future__ import print_function, division
from numpy import array, argmax
from pyscf.nao import tddft_iter
class tddft_iter_x_zip(tddft_iter):
def __init__(self, **kw):
from pyscf.nao.m_fermi_dirac import fermi_dirac_occupations
tddft_iter.__init__(self, **kw)
self.x_zip = kw['x_zip'] if 'x_... | true | true |
f705809ff2c93a8fa8ce2eda3a50fb2aa0ec5726 | 200 | py | Python | http_request_randomizer/requests/errors/ProxyListException.py | nderkach/HTTP_Request_Randomizer | 48f445ff2315c27e096a5ee3165329b637095e83 | [
"MIT"
] | 146 | 2016-01-20T22:36:25.000Z | 2022-03-25T12:55:33.000Z | http_request_randomizer/requests/errors/ProxyListException.py | nderkach/HTTP_Request_Randomizer | 48f445ff2315c27e096a5ee3165329b637095e83 | [
"MIT"
] | 70 | 2016-07-11T18:14:08.000Z | 2022-02-03T05:12:37.000Z | http_request_randomizer/requests/errors/ProxyListException.py | nderkach/HTTP_Request_Randomizer | 48f445ff2315c27e096a5ee3165329b637095e83 | [
"MIT"
] | 61 | 2016-06-07T01:16:21.000Z | 2022-02-21T19:13:22.000Z | class ProxyListException(Exception):
def __init___(self, extraArguments):
Exception.__init__(self, " was raised - {0}".format(extraArguments))
self.dErrorArguments = extraArguments | 50 | 76 | 0.73 | class ProxyListException(Exception):
def __init___(self, extraArguments):
Exception.__init__(self, " was raised - {0}".format(extraArguments))
self.dErrorArguments = extraArguments | true | true |
f70580d96b98a06da9dda9cd1e9dc054bb30b99f | 22,694 | py | Python | arcade/tilemap.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | arcade/tilemap.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | arcade/tilemap.py | Mr-Coxall/arcade | 7767e9c7d7395c0dd35479744052f18ac8c86679 | [
"MIT"
] | null | null | null | """
Functions and classes for managing a map saved in the .tmx format.
Typically these .tmx maps are created using the `Tiled Map Editor`_.
For more information, see the `Platformer Tutorial`_.
.. _Tiled Map Editor: https://www.mapeditor.org/
.. _Platformer Tutorial: http://arcade.academy/examples/platform_tutorial/... | 34.384848 | 165 | 0.59822 |
import copy
import math
import os
from pathlib import Path
from typing import List, Optional, Tuple, Union, cast
import pytiled_parser
from arcade import (
AnimatedTimeBasedSprite,
AnimationKeyframe,
Sprite,
SpriteList,
load_texture,
)
from arcade.arcade_types import Point
from arcade.resources i... | true | true |
f705811f0f591f97ad3e4904b50ed90739fad929 | 98 | py | Python | lab5_threshold_functions/sat/types.py | j-adamczyk/ADPTO_templates | e0a4e77ba8de21fe966388ccee66ef62224a2d99 | [
"MIT"
] | null | null | null | lab5_threshold_functions/sat/types.py | j-adamczyk/ADPTO_templates | e0a4e77ba8de21fe966388ccee66ef62224a2d99 | [
"MIT"
] | null | null | null | lab5_threshold_functions/sat/types.py | j-adamczyk/ADPTO_templates | e0a4e77ba8de21fe966388ccee66ef62224a2d99 | [
"MIT"
] | 1 | 2022-03-25T07:25:26.000Z | 2022-03-25T07:25:26.000Z | from typing import List, Set, Tuple
VertexSets = List[Set[int]]
EdgeList = List[Tuple[int, int]]
| 19.6 | 35 | 0.72449 | from typing import List, Set, Tuple
VertexSets = List[Set[int]]
EdgeList = List[Tuple[int, int]]
| true | true |
f705813cf40811a24e6a3961328998417d3b7e4d | 4,566 | py | Python | main_app/tests/test_models.py | wszoltysek/give_things | 240266460f0d7b7777cdaa8383edce80ea9e6024 | [
"MIT"
] | null | null | null | main_app/tests/test_models.py | wszoltysek/give_things | 240266460f0d7b7777cdaa8383edce80ea9e6024 | [
"MIT"
] | null | null | null | main_app/tests/test_models.py | wszoltysek/give_things | 240266460f0d7b7777cdaa8383edce80ea9e6024 | [
"MIT"
] | null | null | null | import pytest
from main_app.models import *
from main_app.tests.utils import *
# TESTS FOR CREATE MODELS:
@pytest.mark.django_db
def test_create_user():
# Given:
users_before = User.objects.count()
# When:
new_user = fake_user()
# Then:
assert User.objects.count() == users_before + 1
asse... | 26.858824 | 73 | 0.708717 | import pytest
from main_app.models import *
from main_app.tests.utils import *
@pytest.mark.django_db
def test_create_user():
users_before = User.objects.count()
new_user = fake_user()
assert User.objects.count() == users_before + 1
assert new_user.pk == 1
assert new_user.is_anony... | true | true |
f70581a8075af7680223c94e5ae62ce648e7287c | 1,866 | py | Python | homeassistant/components/rpi_power/binary_sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/rpi_power/binary_sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/rpi_power/binary_sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """
A sensor platform which detects underruns and capped status from the official Raspberry Pi Kernel.
Minimal Kernel needed is 4.14+
"""
import logging
from rpi_bad_power import UnderVoltage, new_under_voltage
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
... | 33.927273 | 128 | 0.744373 | import logging
from rpi_bad_power import UnderVoltage, new_under_voltage
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platf... | true | true |
f70582e58b5ad8dd04398cbdb1c24db03fe3139a | 1,746 | py | Python | audiostream.py | ITNano/soundserver | b84cbfd821987ad8af72a6c2677caa0b949abff6 | [
"MIT"
] | null | null | null | audiostream.py | ITNano/soundserver | b84cbfd821987ad8af72a6c2677caa0b949abff6 | [
"MIT"
] | null | null | null | audiostream.py | ITNano/soundserver | b84cbfd821987ad8af72a6c2677caa0b949abff6 | [
"MIT"
] | null | null | null | import numpy
import wave
class Audiostream(object):
def __init__(self, volume_prio=1):
self.volume_prio = volume_prio
def get_data(self, frame_count, channels, width, rate):
return "".join(["\x00"]*frames*self.channels*self.width)
def get_volume_priority(self)... | 30.103448 | 68 | 0.580756 | import numpy
import wave
class Audiostream(object):
def __init__(self, volume_prio=1):
self.volume_prio = volume_prio
def get_data(self, frame_count, channels, width, rate):
return "".join(["\x00"]*frames*self.channels*self.width)
def get_volume_priority(self)... | true | true |
f7058455308d91038b90e873d4f6c9da997ca842 | 4,206 | py | Python | paypalpayoutssdk/payouts/payouts_item_get_request.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 23 | 2020-03-02T13:31:55.000Z | 2022-03-06T11:25:21.000Z | paypalpayoutssdk/payouts/payouts_item_get_request.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 4 | 2020-09-26T08:40:26.000Z | 2022-03-01T17:29:51.000Z | paypalpayoutssdk/payouts/payouts_item_get_request.py | truthiswill/Payouts-Python-SDK | ba04ffafb8165a1b7cdfd5841f08a96dccdd190b | [
"BSD-Source-Code"
] | 21 | 2020-02-07T10:02:57.000Z | 2021-09-09T18:05:02.000Z | # This class was generated on Mon, 23 Dec 2019 12:39:22 IST by version 0.1.0-dev+904328-dirty of Braintree SDK Generator
# payouts_item_get_request.py
# @version 0.1.0-dev+904328-dirty
# @type request
# @data H4sIAAAAAAAC/+xb63PbuBH/3r9ih9eZnGcoyXe5p795bF/j9pq4sZNOx/VYELkSUYMADwta4WTyv3fwIM2XHMdxdH3ok61dPPa3u1gsFuD76CX... | 161.769231 | 3,256 | 0.906087 |
import paypalhttp
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
class PayoutsItemGetRequest:
def __init__(self, payout_item_id):
self.verb = "GET"
self.path = "/v1/payments/payouts-item/{payout_item_id}?".replace("{payout_item_id}", quote(str(pa... | true | true |
f70586c1efc45321eec56c33cb0c96e78f531a4d | 7,859 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_13.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_13.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_13.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 34.169565 | 81 | 0.529457 | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
f705874db830f4f002d426666ec7d088d9bad4bc | 2,291 | py | Python | pages/models.py | allenamusin/metadata-verifier | 7b2c61c231c49c722d1db9c9e83f157b6e2439f4 | [
"MIT"
] | null | null | null | pages/models.py | allenamusin/metadata-verifier | 7b2c61c231c49c722d1db9c9e83f157b6e2439f4 | [
"MIT"
] | 11 | 2020-02-12T03:26:35.000Z | 2022-02-10T12:01:00.000Z | pages/models.py | allenamusin/metadata-verifier | 7b2c61c231c49c722d1db9c9e83f157b6e2439f4 | [
"MIT"
] | null | null | null | import requests
from django.db import models
from django.utils import timezone
from users.models import CustomUser
from datetime import datetime
def get_coordinate(gps, ref):
coordinate = gps[0] + gps[1]/60 + gps[2]/3600
if ref == 'W':
coordinate = -coordinate
return coordinate
def get_timestamp(t... | 34.712121 | 81 | 0.611523 | import requests
from django.db import models
from django.utils import timezone
from users.models import CustomUser
from datetime import datetime
def get_coordinate(gps, ref):
coordinate = gps[0] + gps[1]/60 + gps[2]/3600
if ref == 'W':
coordinate = -coordinate
return coordinate
def get_timestamp(t... | true | true |
f705892d7832be8bc0c55823b07c8570e5d2852f | 442 | py | Python | src/container.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | null | null | null | src/container.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | 3 | 2019-12-26T05:13:55.000Z | 2020-03-07T06:59:56.000Z | src/container.py | sudeep0901/python | 7a50af12e72d21ca4cad7f2afa4c6f929552043f | [
"MIT"
] | null | null | null | a = [1, "a"]
print(list)
print(dir(list))
list = [1, "a"]
print(dir(list))
tuple = ("a", "b")
print(list)
print(tuple)
dictn = {"key": "dictionary",
"d" :a}
print(dictn)
def factorial(n):
"Factorial calculation string document string"
# print("Calculating factorial of ", n)
if n <= 1: return... | 14.733333 | 50 | 0.615385 | a = [1, "a"]
print(list)
print(dir(list))
list = [1, "a"]
print(dir(list))
tuple = ("a", "b")
print(list)
print(tuple)
dictn = {"key": "dictionary",
"d" :a}
print(dictn)
def factorial(n):
if n <= 1: return 1
else: return n * factorial(n - 1)
print(factorial(100))
print(factorial.__doc__)... | true | true |
f7058b34f1196160d71f990667c61db4148e381e | 3,132 | py | Python | pype/plugins/maya/publish/extract_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/extract_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | pype/plugins/maya/publish/extract_animation.py | kalisp/pype | 28bbffaf2d12ccee48313cd9985e8dfa05e81a5c | [
"MIT"
] | null | null | null | import os
from maya import cmds
import avalon.maya
import pype.api
from pype.hosts.maya.lib import extract_alembic
class ExtractAnimation(pype.api.Extractor):
"""Produce an alembic of just point positions and normals.
Positions and normals, uvs, creases are preserved, but nothing more,
for plain and pr... | 33.677419 | 77 | 0.559387 | import os
from maya import cmds
import avalon.maya
import pype.api
from pype.hosts.maya.lib import extract_alembic
class ExtractAnimation(pype.api.Extractor):
label = "Extract Animation"
hosts = ["maya"]
families = ["animation"]
def process(self, instance):
out_sets = [node for n... | true | true |
f7058bd93bd1ec52a35d57cf42075a5bb3de9861 | 14,085 | py | Python | passerine/db/session.py | shiroyuki/passerine | 6e50ca4a8892da51af68561ac01601bfe8c9fd9c | [
"MIT"
] | null | null | null | passerine/db/session.py | shiroyuki/passerine | 6e50ca4a8892da51af68561ac01601bfe8c9fd9c | [
"MIT"
] | 1 | 2017-03-11T12:15:55.000Z | 2017-03-11T12:15:55.000Z | passerine/db/session.py | shiroyuki/passerine | 6e50ca4a8892da51af68561ac01601bfe8c9fd9c | [
"MIT"
] | null | null | null |
import re
from passerine.db.common import ProxyObject, ProxyFactory, ProxyCollection
from passerine.db.repository import Repository
from passerine.db.entity import get_relational_map
from passerine.db.exception import IntegrityConstraintError, UnsupportedRepositoryReferenceError
from passe... | 34.186893 | 121 | 0.61349 |
import re
from passerine.db.common import ProxyObject, ProxyFactory, ProxyCollection
from passerine.db.repository import Repository
from passerine.db.entity import get_relational_map
from passerine.db.exception import IntegrityConstraintError, UnsupportedRepositoryReferenceError
from passe... | true | true |
f7058c504d2e6bb6e65bff54137c6efbe95c484b | 13,954 | py | Python | parallize.py | sksg/parallize | 58d211fd92a4cac97b1d7795932157b839e42b2b | [
"MIT"
] | null | null | null | parallize.py | sksg/parallize | 58d211fd92a4cac97b1d7795932157b839e42b2b | [
"MIT"
] | null | null | null | parallize.py | sksg/parallize | 58d211fd92a4cac97b1d7795932157b839e42b2b | [
"MIT"
] | null | null | null | import numpy as np
from numpy.core.numerictypes import typecodes
import inspect
import functools
import re
import builtins
import os
from concurrent.futures import ThreadPoolExecutor as thread_pool
from concurrent.futures import ProcessPoolExecutor as process_pool
from concurrent.futures import as_completed
def _iter... | 38.021798 | 78 | 0.560484 | import numpy as np
from numpy.core.numerictypes import typecodes
import inspect
import functools
import re
import builtins
import os
from concurrent.futures import ThreadPoolExecutor as thread_pool
from concurrent.futures import ProcessPoolExecutor as process_pool
from concurrent.futures import as_completed
def _iter... | true | true |
f7058c86361e6fb62602fa1810c1f92feb394991 | 21,195 | py | Python | tests/reflection.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | 1 | 2019-11-17T04:55:26.000Z | 2019-11-17T04:55:26.000Z | tests/reflection.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | null | null | null | tests/reflection.py | onyb/peewee | 323983c2ecf2ec70a14ed78ddd00cf5cd17d56e2 | [
"MIT"
] | 1 | 2019-07-07T20:57:22.000Z | 2019-07-07T20:57:22.000Z | import datetime
import os
import re
from peewee import *
from playhouse.reflection import *
from .base import IS_SQLITE_OLD
from .base import ModelTestCase
from .base import TestModel
from .base import db
from .base import requires_models
from .base import requires_sqlite
from .base import skip_if
from .base_models i... | 35.325 | 79 | 0.566407 | import datetime
import os
import re
from peewee import *
from playhouse.reflection import *
from .base import IS_SQLITE_OLD
from .base import ModelTestCase
from .base import TestModel
from .base import db
from .base import requires_models
from .base import requires_sqlite
from .base import skip_if
from .base_models i... | true | true |
f7058f13d20f3f1ca760719af81ddcb6f2a11b08 | 2,334 | py | Python | robosuite/models/robots/panda_robot.py | StanfordVL/Lasersuite | 8b78c3d202f2a4b8712c5f228feaf5fae61f16e9 | [
"MIT"
] | 5 | 2020-08-09T16:47:38.000Z | 2021-05-06T05:43:12.000Z | robosuite/models/robots/panda_robot.py | StanfordVL/Lasersuite | 8b78c3d202f2a4b8712c5f228feaf5fae61f16e9 | [
"MIT"
] | 1 | 2020-11-06T06:31:08.000Z | 2020-11-06T06:31:08.000Z | robosuite/models/robots/panda_robot.py | StanfordVL/Lasersuite | 8b78c3d202f2a4b8712c5f228feaf5fae61f16e9 | [
"MIT"
] | null | null | null | import numpy as np
from .robot_model import RobotModel
from ...utils.mjcf_utils import xml_path_completion
class Panda(RobotModel):
"""Panda is a sensitive single-arm robot designed by Franka."""
def __init__(self, idn=0, bottom_offset=(0, 0, -0.913)):
"""
Args:
idn (int or str): ... | 28.814815 | 109 | 0.582262 | import numpy as np
from .robot_model import RobotModel
from ...utils.mjcf_utils import xml_path_completion
class Panda(RobotModel):
def __init__(self, idn=0, bottom_offset=(0, 0, -0.913)):
super().__init__(xml_path_completion("robots/panda/robot.xml"), idn=idn, bottom_offset=bottom_offset)
... | true | true |
f7058f6fa6f834bef960f8c52d0d2be8e352837f | 11,340 | py | Python | kubernetes_asyncio/client/models/v1beta1_cron_job_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1beta1_cron_job_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1beta1_cron_job_spec.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.19.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 38.969072 | 324 | 0.67134 |
import pprint
import re
import six
from kubernetes_asyncio.client.configuration import Configuration
class V1beta1CronJobSpec(object):
openapi_types = {
'concurrency_policy': 'str',
'failed_jobs_history_limit': 'int',
'job_template': 'V1beta1JobTemplateSpec',
'schedule': '... | true | true |
f705902ea07b23776e92a0707bf931cd4228f88f | 489 | py | Python | src/doing/pr/open_pr.py | tijlk/doing-cli | 048e04aaa9f3f99f1a8013fe4cd8a488180f5f2b | [
"MIT"
] | 12 | 2021-03-23T13:27:33.000Z | 2022-02-20T05:44:56.000Z | src/doing/pr/open_pr.py | tijlk/doing-cli | 048e04aaa9f3f99f1a8013fe4cd8a488180f5f2b | [
"MIT"
] | 63 | 2021-03-23T12:54:00.000Z | 2022-02-24T15:12:45.000Z | src/doing/pr/open_pr.py | tijlk/doing-cli | 048e04aaa9f3f99f1a8013fe4cd8a488180f5f2b | [
"MIT"
] | 3 | 2021-04-09T14:40:23.000Z | 2021-07-15T13:26:40.000Z | import click
from doing.utils import get_config
from doing.utils import get_repo_name
from typing import Union
def cmd_open_pr(pullrequest_id: Union[str, int]) -> None:
"""
Open a specific PULLREQUEST_ID. '!' prefix is allowed.
"""
pullrequest_id = str(pullrequest_id).lstrip("!").strip()
project ... | 28.764706 | 97 | 0.721881 | import click
from doing.utils import get_config
from doing.utils import get_repo_name
from typing import Union
def cmd_open_pr(pullrequest_id: Union[str, int]) -> None:
pullrequest_id = str(pullrequest_id).lstrip("!").strip()
project = get_config("project")
organization = get_config("organization")
... | true | true |
f70591035fd509c27b46a06d617bc227adafc45a | 332 | py | Python | time_management/facade_abc.py | artorias111/time-management | c79c31e070447e70bd3a54e2ad77d88d9821ac2e | [
"MIT"
] | null | null | null | time_management/facade_abc.py | artorias111/time-management | c79c31e070447e70bd3a54e2ad77d88d9821ac2e | [
"MIT"
] | null | null | null | time_management/facade_abc.py | artorias111/time-management | c79c31e070447e70bd3a54e2ad77d88d9821ac2e | [
"MIT"
] | null | null | null | from abc import ABC
class AbcFacade(ABC):
"""Any interface will expect to be able to invoke the following methods."""
def count_rows(self):
pass
def get_rows(self):
pass
def get_last_workday(self):
pass
def delete_history(self):
pass
def disconnect(self):
... | 15.809524 | 79 | 0.611446 | from abc import ABC
class AbcFacade(ABC):
def count_rows(self):
pass
def get_rows(self):
pass
def get_last_workday(self):
pass
def delete_history(self):
pass
def disconnect(self):
pass
| true | true |
f7059112109560001ae224464bc42dacbe27b49c | 29,512 | py | Python | Virtual-Environment/lib/python3.7/site-packages/rich/pretty.py | jguev/instant-insanity | 98894a228d20e7abc5c6d123772aa8cbdaefd372 | [
"MIT"
] | 2 | 2020-12-14T21:02:54.000Z | 2021-12-25T05:49:28.000Z | Virtual-Environment/lib/python3.7/site-packages/rich/pretty.py | jguev/instant-insanity | 98894a228d20e7abc5c6d123772aa8cbdaefd372 | [
"MIT"
] | 4 | 2021-11-11T10:23:35.000Z | 2021-12-01T10:28:30.000Z | Virtual-Environment/lib/python3.7/site-packages/rich/pretty.py | jguev/instant-insanity | 98894a228d20e7abc5c6d123772aa8cbdaefd372 | [
"MIT"
] | null | null | null | import builtins
import os
from rich.repr import RichReprResult
import sys
from array import array
from collections import Counter, defaultdict, deque, UserDict, UserList
import dataclasses
from dataclasses import dataclass, fields, is_dataclass
from inspect import isclass
from itertools import islice
import re
from typ... | 35.386091 | 134 | 0.557366 | import builtins
import os
from rich.repr import RichReprResult
import sys
from array import array
from collections import Counter, defaultdict, deque, UserDict, UserList
import dataclasses
from dataclasses import dataclass, fields, is_dataclass
from inspect import isclass
from itertools import islice
import re
from typ... | true | true |
f7059188ba5afe67da1d44238af516ec78351d12 | 2,742 | py | Python | tensorflow_gan/examples/stargan_estimator/train_test.py | jiasenwu/gan | f92aeca269365180125d4e4c57c53cbf5e679299 | [
"Apache-2.0"
] | 1 | 2020-07-30T12:33:56.000Z | 2020-07-30T12:33:56.000Z | tensorflow_gan/examples/stargan_estimator/train_test.py | jiasenwu/gan | f92aeca269365180125d4e4c57c53cbf5e679299 | [
"Apache-2.0"
] | null | null | null | tensorflow_gan/examples/stargan_estimator/train_test.py | jiasenwu/gan | f92aeca269365180125d4e4c57c53cbf5e679299 | [
"Apache-2.0"
] | 1 | 2021-05-31T23:19:44.000Z | 2021-05-31T23:19:44.000Z | # coding=utf-8
# Copyright 2019 The TensorFlow GAN Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 33.439024 | 77 | 0.731947 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow_gan.examples.stargan_estimator import train_lib
mock = tf.compat.v1.test.mock
def _test_generator(input_images, _):
return input_... | true | true |
f70592ac90e928d0c5190de78accdb47db98dc6e | 1,518 | py | Python | app.py | aldinaufal21/qual-id | c3205256d1483831117b001e3929e5175aff78ee | [
"MIT"
] | null | null | null | app.py | aldinaufal21/qual-id | c3205256d1483831117b001e3929e5175aff78ee | [
"MIT"
] | null | null | null | app.py | aldinaufal21/qual-id | c3205256d1483831117b001e3929e5175aff78ee | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify, render_template, make_response
from qual_id.pattern import Pattern
import random
app = Flask(__name__)
@app.route('/get/', methods=['GET'])
def get_response():
pattern = Pattern(request.args.get("pattern", ""))
number = int(request.args.get("number", 1))
response_obj... | 25.3 | 81 | 0.700264 | from flask import Flask, request, jsonify, render_template, make_response
from qual_id.pattern import Pattern
import random
app = Flask(__name__)
@app.route('/get/', methods=['GET'])
def get_response():
pattern = Pattern(request.args.get("pattern", ""))
number = int(request.args.get("number", 1))
response_obj... | true | true |
f70593151fa24ae167040805a1b24f6d3fdec51d | 633 | py | Python | app/main/forms.py | markmumba/personal-blog | c2a3a290f1d6ce847e2db4cba2f799b8292889f9 | [
"MIT"
] | null | null | null | app/main/forms.py | markmumba/personal-blog | c2a3a290f1d6ce847e2db4cba2f799b8292889f9 | [
"MIT"
] | null | null | null | app/main/forms.py | markmumba/personal-blog | c2a3a290f1d6ce847e2db4cba2f799b8292889f9 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms.validators import Required
from wtforms import TextAreaField,SubmitField,StringField
from ..models import User
class UpdateProfile(FlaskForm):
bio = TextAreaField('Update bio.',validators = [Required()])
submit = SubmitField('Update')
class PostAblog (FlaskForm):
... | 35.166667 | 71 | 0.739336 | from flask_wtf import FlaskForm
from wtforms.validators import Required
from wtforms import TextAreaField,SubmitField,StringField
from ..models import User
class UpdateProfile(FlaskForm):
bio = TextAreaField('Update bio.',validators = [Required()])
submit = SubmitField('Update')
class PostAblog (FlaskForm):
... | true | true |
f705942f8f1cc804e3b4671a85ed097d24911237 | 27 | py | Python | __init__.py | JDavidMoreno/meditative_cards | b935a422037c4f3ed076ce1bcd5bcdcbe24f1565 | [
"MIT"
] | null | null | null | __init__.py | JDavidMoreno/meditative_cards | b935a422037c4f3ed076ce1bcd5bcdcbe24f1565 | [
"MIT"
] | null | null | null | __init__.py | JDavidMoreno/meditative_cards | b935a422037c4f3ed076ce1bcd5bcdcbe24f1565 | [
"MIT"
] | 1 | 2021-04-03T18:00:14.000Z | 2021-04-03T18:00:14.000Z |
from . import controllers
| 9 | 25 | 0.777778 |
from . import controllers
| true | true |
f70594d9ea97d88b1de224836e5a52dd96a783ea | 6,523 | py | Python | experimental/inject.py | LuisCerdenoMota/SHERLOCK | 5fb52795d3ab44e27bc7dbc6f2c2e6c214995ba1 | [
"MIT"
] | null | null | null | experimental/inject.py | LuisCerdenoMota/SHERLOCK | 5fb52795d3ab44e27bc7dbc6f2c2e6c214995ba1 | [
"MIT"
] | null | null | null | experimental/inject.py | LuisCerdenoMota/SHERLOCK | 5fb52795d3ab44e27bc7dbc6f2c2e6c214995ba1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
#::: modules
import numpy as np
import os, sys
import ellc
from transitleastsquares import catalog_info
import astropy.constants as ac
import astropy.units as u
import lightkurve as lk
import pandas as pd
... | 38.146199 | 126 | 0.62226 |
from __future__ import print_function, division, absolute_import
import numpy as np
import os, sys
import ellc
from transitleastsquares import catalog_info
import astropy.constants as ac
import astropy.units as u
import lightkurve as lk
import pandas as pd
np.random.seed(42)
TIC_ID = 85400193
lcf= lk.searc... | true | true |
f70596147d6743d8b4b0dc81565a51e99185ba66 | 43,146 | py | Python | pymclevel/leveldb.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 237 | 2018-02-04T19:13:31.000Z | 2022-03-26T03:06:07.000Z | pymclevel/leveldb.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 551 | 2015-01-01T02:36:53.000Z | 2018-02-01T00:03:12.000Z | pymclevel/leveldb.py | bennettdc/MCEdit-Unified | 90abfb170c65b877ac67193e717fa3a3ded635dd | [
"0BSD"
] | 97 | 2015-01-02T01:31:12.000Z | 2018-01-22T05:37:47.000Z | # !/usr/bin/env python
#
# Copyright (C) 2012 Space Monkey, Inc.
#
# 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,... | 36.075251 | 137 | 0.644301 |
__author__ = "JT Olds"
__email__ = "jt@spacemonkey.com"
import bisect
import ctypes
import ctypes.util
import weakref
import threading
from collections import namedtuple
import os
import sys
import platform
import directories
import logging
log = logging.getLogger(__name__)
try:
plat ... | true | true |
f7059649cace577ed483d9e7b5ab728bae8e0607 | 12,268 | py | Python | VMBackup/main/PluginHost.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | 2 | 2021-11-02T00:16:29.000Z | 2022-02-17T12:08:42.000Z | VMBackup/main/PluginHost.py | jamvar/azure-linux-extensions | 66610daae2ef09f7920d9c4aa2e99a3035fe76a6 | [
"Apache-2.0"
] | 3 | 2019-07-29T20:25:09.000Z | 2019-08-13T00:00:45.000Z | VMBackup/main/PluginHost.py | ChrisCoe/azure-linux-extensions | 1ca6fce15eca3ddefc33651b094c9a4b4e52fa31 | [
"Apache-2.0"
] | 1 | 2017-07-17T18:52:10.000Z | 2017-07-17T18:52:10.000Z | import time
import sys
import os
import threading
try:
import ConfigParser as ConfigParsers
except ImportError:
import configparser as ConfigParsers
from common import CommonVariables
from pwd import getpwuid
from stat import *
import traceback
# [pre_post]
# "timeout" : (in seconds),
#
# ....... | 43.814286 | 175 | 0.623329 | import time
import sys
import os
import threading
try:
import ConfigParser as ConfigParsers
except ImportError:
import configparser as ConfigParsers
from common import CommonVariables
from pwd import getpwuid
from stat import *
import traceback
... | true | true |
f70596fbe9596e1848acaad7aac1ea065663307c | 20,363 | py | Python | clusterloader2/pkg/prometheus/manifests/dashboards/master-dashboard.dashboard.py | ruquanzhao/perf-tests | e63056acb9ae69d2d0bf6449039b0dfda55d129f | [
"Apache-2.0"
] | 1 | 2021-06-17T07:19:59.000Z | 2021-06-17T07:19:59.000Z | clusterloader2/pkg/prometheus/manifests/dashboards/master-dashboard.dashboard.py | yangjunmyfm192085/perf-tests | 432229eeb3f74027eab9865ae0eb02078f50238f | [
"Apache-2.0"
] | null | null | null | clusterloader2/pkg/prometheus/manifests/dashboards/master-dashboard.dashboard.py | yangjunmyfm192085/perf-tests | 432229eeb3f74027eab9865ae0eb02078f50238f | [
"Apache-2.0"
] | 4 | 2021-01-29T08:31:11.000Z | 2021-06-14T06:08:32.000Z | #!/usr/bin/env python3
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 33.60231 | 149 | 0.582282 |
from grafanalib import core as g
import defaults as d
def api_call_latency_panel(expression):
def api_call_latency(title, verb, scope, threshold):
return d.Graph(
title=title,
targets=[
g.Target(expr=str(threshold), legendFormat="threshold"),
... | true | true |
f705987652a631c2ebaab205528fe807cc950ac0 | 2,496 | py | Python | consul/std.py | DataDog/python-consul | 104c8c4fd6a0aa8ec24dd0fe911af815672602ca | [
"MIT"
] | null | null | null | consul/std.py | DataDog/python-consul | 104c8c4fd6a0aa8ec24dd0fe911af815672602ca | [
"MIT"
] | 1 | 2021-01-05T14:46:32.000Z | 2021-01-05T14:46:32.000Z | consul/std.py | DataDog/python-consul | 104c8c4fd6a0aa8ec24dd0fe911af815672602ca | [
"MIT"
] | null | null | null | import requests
import os
from consul import base
__all__ = ["Consul"]
class HTTPClient(base.HTTPClient):
def __init__(self, *args, **kwargs):
self.timeout = kwargs.pop("timeout", None)
super(HTTPClient, self).__init__(*args, **kwargs)
self.session = requests.session()
self._pid... | 30.814815 | 87 | 0.567708 | import requests
import os
from consul import base
__all__ = ["Consul"]
class HTTPClient(base.HTTPClient):
def __init__(self, *args, **kwargs):
self.timeout = kwargs.pop("timeout", None)
super(HTTPClient, self).__init__(*args, **kwargs)
self.session = requests.session()
self._pid... | true | true |
f7059973a4d9a361ba270c09265b9b2266bf6ff4 | 27,261 | py | Python | mindspore/nn/metrics/confusion_matrix.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/metrics/confusion_matrix.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/metrics/confusion_matrix.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.739067 | 120 | 0.583874 |
import numpy as np
from mindspore._checkparam import Validator as validator
from .metric import Metric
class ConfusionMatrix(Metric):
TARGET = "target"
PREDICTION = "prediction"
ALL = "all"
NO_NORM = "no_norm"
def __init__(self, num_classes, normalize=NO_NORM, threshold=0.5):
... | true | true |
f7059c170fbd2ef4ccd70edeaa67879926e52cb0 | 11,928 | py | Python | multiBatelo/multielo.py | Balavignesh/badminton-elo-dashboard | df380afb26c89827111f7316df381408d7d19298 | [
"MIT"
] | null | null | null | multiBatelo/multielo.py | Balavignesh/badminton-elo-dashboard | df380afb26c89827111f7316df381408d7d19298 | [
"MIT"
] | null | null | null | multiBatelo/multielo.py | Balavignesh/badminton-elo-dashboard | df380afb26c89827111f7316df381408d7d19298 | [
"MIT"
] | null | null | null | import numpy as np
from typing import Union, List, Callable
import logging
from multiBatelo.score_functions import create_exponential_score_function
DEFAULT_K_VALUE = 32
DEFAULT_D_VALUE = 400
DEFAULT_SCORING_FUNCTION_BASE = 1
_default_logger = logging.getLogger("multielo.multielo")
class MultiElo:
"""
Gen... | 44.674157 | 111 | 0.655349 | import numpy as np
from typing import Union, List, Callable
import logging
from multiBatelo.score_functions import create_exponential_score_function
DEFAULT_K_VALUE = 32
DEFAULT_D_VALUE = 400
DEFAULT_SCORING_FUNCTION_BASE = 1
_default_logger = logging.getLogger("multielo.multielo")
class MultiElo:
def __init... | true | true |
f7059d3b8fda64f363f295486c2fbf3de3035548 | 7,411 | py | Python | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyEventsHTMLVisitor.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyEventsHTMLVisitor.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | Autocoders/Python/src/fprime_ac/generators/visitors/InstanceTopologyEventsHTMLVisitor.py | LeStarch/lgtm-fprime | 904b0311fe647745b29075d44259d1dc1f4284ae | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# NAME: InstanceTopologyHTMLVisitor.py
#
# DESCRIPTION: A visitor responsible for the generation of HTML tables
# of event ID's, etc.
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : Sep. 13, 2016
#
# Copyrigh... | 34.793427 | 93 | 0.568344 |
#
# AUTHOR: reder
# EMAIL: reder@jpl.nasa.gov
# DATE CREATED : Sep. 13, 2016
#
# Copyright 2016, California Institute of Technology.
# ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged.
# ===============================================================================
#
# Python standard modules
#
imp... | true | true |
f7059d4b996373df631835952df25f3736b20114 | 10,386 | py | Python | Tests/test_samtools_tool.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | null | null | null | Tests/test_samtools_tool.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | null | null | null | Tests/test_samtools_tool.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | null | null | null | # Copyright 2014 by Saket Choudhary. Based on test_Clustalw_tool.py by Peter
# Cock .
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Last Checked with samtools [0.1.18 (r982:295)]
from Bio imp... | 43.638655 | 92 | 0.612074 |
from Bio import MissingExternalDependencyError
import sys
import os
import unittest
from Bio.Sequencing.Applications import SamtoolsViewCommandline
from Bio.Sequencing.Applications import SamtoolsCalmdCommandline
from Bio.Sequencing.Applications import SamtoolsCatCommandline
from Bio.Sequencing.Applications im... | true | true |
f7059d75bd3c6acb85c90246d579ae72b76286c1 | 14,941 | py | Python | stable_baselines3/sac/sac.py | squalidux/stable-baselines3 | 72690b3ed0635c68f037b3dc121bd9987a6e82a8 | [
"MIT"
] | 3 | 2022-01-22T21:24:03.000Z | 2022-03-31T05:32:54.000Z | stable_baselines3/sac/sac.py | squalidux/stable-baselines3 | 72690b3ed0635c68f037b3dc121bd9987a6e82a8 | [
"MIT"
] | 1 | 2020-07-31T08:19:32.000Z | 2020-07-31T08:19:32.000Z | stable_baselines3/sac/sac.py | squalidux/stable-baselines3 | 72690b3ed0635c68f037b3dc121bd9987a6e82a8 | [
"MIT"
] | 1 | 2022-03-10T11:33:06.000Z | 2022-03-10T11:33:06.000Z | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common.buffers import ReplayBuffer
from stable_baselines3.common.noise import ActionNoise
from stable_baselines3.common.off_policy_algorithm imp... | 47.431746 | 116 | 0.658122 | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common.buffers import ReplayBuffer
from stable_baselines3.common.noise import ActionNoise
from stable_baselines3.common.off_policy_algorithm imp... | true | true |
f7059d8c63468534c4d5a45f70eb14aa1a9ab387 | 1,065 | py | Python | constants.py | ra101/Pose2Input-MKKE | 11905d19fbc18acc8b577f41d3149013cca76aab | [
"MIT"
] | 2 | 2021-08-16T06:25:04.000Z | 2021-08-17T01:28:53.000Z | constants.py | ra101/Pose2Input-MKKE | 11905d19fbc18acc8b577f41d3149013cca76aab | [
"MIT"
] | null | null | null | constants.py | ra101/Pose2Input-MKKE | 11905d19fbc18acc8b577f41d3149013cca76aab | [
"MIT"
] | null | null | null | # ./constants.py
import os
import enum
from dotenv import load_dotenv
load_dotenv()
@enum.unique
class InputConfig(enum.Enum):
'''
Config for the gameplay, Takes input from .env
Value should be something tha can be used by pyAutoGUI
If not available then, uses default input config (mine)
and Y... | 30.428571 | 63 | 0.62723 |
import os
import enum
from dotenv import load_dotenv
load_dotenv()
@enum.unique
class InputConfig(enum.Enum):
DEFAULT = ''
UP = os.getenv('UP', 'up').lower()
DOWN = os.getenv('DOWN', 'down').lower()
LEFT = os.getenv('LEFT', 'left').lower()
RIGHT = os.getenv('RIGHT', 'right').lower()
FRONT... | true | true |
f7059f70f021d953948645a9e129f288f86fa8ff | 572 | py | Python | src/airflow_actionproject/hooks/__init__.py | actionprojecteu/airflow-actionproject | 6518e73e5709ebce927e0b463b5e36d80194491c | [
"MIT"
] | null | null | null | src/airflow_actionproject/hooks/__init__.py | actionprojecteu/airflow-actionproject | 6518e73e5709ebce927e0b463b5e36d80194491c | [
"MIT"
] | null | null | null | src/airflow_actionproject/hooks/__init__.py | actionprojecteu/airflow-actionproject | 6518e73e5709ebce927e0b463b5e36d80194491c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright (c) 2021
#
# See the LICENSE file for details
# see the AUTHORS file for authors
# ----------------------------------------------------------------------
#--------------------
# System wide imports
# ----------... | 19.724138 | 72 | 0.274476 | true | true | |
f7059fa1462d4d297a6397aa32f4f05bb16f2d55 | 492 | py | Python | Programs/Desktop_Notifier.py | Phinix403/Python | 64dec2dfb47a966a603dcdf1c65b32a7e3184672 | [
"MIT"
] | null | null | null | Programs/Desktop_Notifier.py | Phinix403/Python | 64dec2dfb47a966a603dcdf1c65b32a7e3184672 | [
"MIT"
] | null | null | null | Programs/Desktop_Notifier.py | Phinix403/Python | 64dec2dfb47a966a603dcdf1c65b32a7e3184672 | [
"MIT"
] | null | null | null | # Install Notification Module - pip install notify2
import notify2
import time
import os
notify2.init('Notification')
icon_path = os.getcwd() + "/icon.ico"
def notiFunc():
noti = notify2.Notification("Welcome to Techix", "Techix is an Tech Dependent Youtube Channel, Please Subscribe to get more Videos Frequentl... | 25.894737 | 164 | 0.73374 |
import notify2
import time
import os
notify2.init('Notification')
icon_path = os.getcwd() + "/icon.ico"
def notiFunc():
noti = notify2.Notification("Welcome to Techix", "Techix is an Tech Dependent Youtube Channel, Please Subscribe to get more Videos Frequently.", icon=icon_path)
noti.set_urgency(notify2.U... | true | true |
f705a06c95a7d04645d3ccb50784ff444cc6e934 | 2,746 | py | Python | youtube_dl/extractor/toypics.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 66,635 | 2019-03-10T21:34:18.000Z | 2022-03-31T23:50:31.000Z | youtube_dl/extractor/toypics.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 10,936 | 2019-03-10T21:35:47.000Z | 2022-03-31T23:46:52.000Z | youtube_dl/extractor/toypics.py | hackarada/youtube-dl | 2ba46715a41fe074eab2221170b2ac78fab93fad | [
"Unlicense"
] | 15,194 | 2019-03-10T21:09:27.000Z | 2022-03-31T22:13:49.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
import re
class ToypicsIE(InfoExtractor):
IE_DESC = 'Toypics video'
_VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://videos.toypics.net/view/514/chancebulged,-2-1/',... | 30.175824 | 116 | 0.499636 |
from __future__ import unicode_literals
from .common import InfoExtractor
import re
class ToypicsIE(InfoExtractor):
IE_DESC = 'Toypics video'
_VALID_URL = r'https?://videos\.toypics\.net/view/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://videos.toypics.net/view/514/chancebulged,-2-1/',
'md5':... | true | true |
f705a0bdf5f2e9c98e441ea76e922c6518a8fec9 | 6,654 | py | Python | lingvo/core/wpm_encoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 4 | 2019-06-08T00:19:06.000Z | 2020-08-03T16:28:53.000Z | lingvo/core/wpm_encoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | null | null | null | lingvo/core/wpm_encoder.py | pizzahan/lingvo | 9b85b7ba5d037701302efa807841c05223bc7d1d | [
"Apache-2.0"
] | 5 | 2018-12-11T08:05:16.000Z | 2020-05-30T03:40:13.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 33.104478 | 89 | 0.666366 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import tensorflow as tf
from lingvo.core.ops import py_x_ops
NO_TOKEN = 1 << 31 - 1
NO_TOKEN_STRING = '<unk>'
SENTENCE_START_STRING = '<s>'
SENTENCE_END_STRING = '</s>'
BOW_STR ... | true | true |
f705a1659e4db8d71a128447488a338279e58453 | 10,720 | py | Python | cogs/gachiGASM.py | s0hvaperuna/Not-a-bot | 933ae57e70a5c98fed6800205595af21bbf1a10e | [
"MIT"
] | 4 | 2017-03-08T13:38:43.000Z | 2018-08-03T13:42:17.000Z | cogs/gachiGASM.py | s0hvaperuna/Not-a-bot | 933ae57e70a5c98fed6800205595af21bbf1a10e | [
"MIT"
] | 3 | 2018-08-03T13:14:25.000Z | 2018-10-02T16:22:04.000Z | cogs/gachiGASM.py | s0hvaperuna/Not-a-bot | 933ae57e70a5c98fed6800205595af21bbf1a10e | [
"MIT"
] | 4 | 2017-04-08T23:22:00.000Z | 2018-10-01T12:15:36.000Z | import logging
import os
import traceback
from datetime import datetime, time, timezone
from random import Random, choice
import disnake
from disnake.ext import tasks
from disnake.ext.commands import BucketType, cooldown, guild_only
from bot.bot import command, group, has_permissions
from bot.globals import PLAYLISTS... | 54.416244 | 156 | 0.648601 | import logging
import os
import traceback
from datetime import datetime, time, timezone
from random import Random, choice
import disnake
from disnake.ext import tasks
from disnake.ext.commands import BucketType, cooldown, guild_only
from bot.bot import command, group, has_permissions
from bot.globals import PLAYLISTS... | true | true |
f705a3715e94cf0904331d0ec946cb635a00608e | 4,169 | py | Python | setup.py | igilitschenski/quaternion | 44dd138fa7e95e55d0ccd4a7620a3587cf314b4f | [
"MIT"
] | 2 | 2018-08-12T02:01:37.000Z | 2020-05-12T11:56:07.000Z | setup.py | igilitschenski/quaternion | 44dd138fa7e95e55d0ccd4a7620a3587cf314b4f | [
"MIT"
] | 1 | 2018-08-12T21:05:01.000Z | 2018-08-12T21:05:01.000Z | setup.py | igilitschenski/quaternion | 44dd138fa7e95e55d0ccd4a7620a3587cf314b4f | [
"MIT"
] | 1 | 2020-10-01T08:49:33.000Z | 2020-10-01T08:49:33.000Z | #!/usr/bin/env python
# Copyright (c) 2018, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/quaternion/blob/master/LICENSE>
# Construct the version number from the date and time this python version was created.
from os import environ
from sys import platform
on_windows = ('win' in platform.low... | 49.047059 | 141 | 0.656272 |
from os import environ
from sys import platform
on_windows = ('win' in platform.lower() and not 'darwin' in platform.lower())
if "package_version" in environ:
version = environ["package_version"]
print("Setup.py using environment version='{0}'".format(version))
else:
print("The variable 'package_versi... | true | true |
f705a4cd64c0bf62c1cc3fdc3fdff2a1600a087a | 879 | py | Python | textworld/challenges/tests/test_coin_collector.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 307 | 2019-05-07T01:51:55.000Z | 2022-03-31T19:35:47.000Z | textworld/challenges/tests/test_coin_collector.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 84 | 2019-05-08T14:24:36.000Z | 2022-03-31T14:35:16.000Z | textworld/challenges/tests/test_coin_collector.py | JohnnySun8/TextWorld | 9a54e9d642f7605a0f3ebba3285cdd04047975e2 | [
"MIT"
] | 70 | 2019-05-21T21:36:56.000Z | 2022-02-28T12:04:27.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import textworld
from textworld.challenges import coin_collector
def test_making_coin_collector():
expected = {
1: {"quest_length": 1, "nb_rooms": 1},
100: {"quest_length": 100, "nb_rooms": 100},
... | 35.16 | 78 | 0.624573 |
import textworld
from textworld.challenges import coin_collector
def test_making_coin_collector():
expected = {
1: {"quest_length": 1, "nb_rooms": 1},
100: {"quest_length": 100, "nb_rooms": 100},
101: {"quest_length": 1, "nb_rooms": 2},
200: {"quest_length": 100, "nb_rooms": 200... | true | true |
f705a62076eaad583f13420e3065b76727c22256 | 2,831 | py | Python | core/cooggerapp/forms.py | maksatweb/coogger | 480d4cccb2c6876fba116511b72775e2e434245b | [
"MIT"
] | null | null | null | core/cooggerapp/forms.py | maksatweb/coogger | 480d4cccb2c6876fba116511b72775e2e434245b | [
"MIT"
] | null | null | null | core/cooggerapp/forms.py | maksatweb/coogger | 480d4cccb2c6876fba116511b72775e2e434245b | [
"MIT"
] | 1 | 2019-07-01T10:08:33.000Z | 2019-07-01T10:08:33.000Z | # django
from django import forms
from django.contrib.auth.models import User
# choices
from core.cooggerapp.choices import *
# models
from core.cooggerapp.models import (
Content, OtherAddressesOfUsers, UserProfile,
ReportModel, UTopic, Issue)
from .models.utils import send_mail
class UTopicForm(forms.Mod... | 23.396694 | 106 | 0.607559 |
from django import forms
from django.contrib.auth.models import User
from core.cooggerapp.choices import *
from core.cooggerapp.models import (
Content, OtherAddressesOfUsers, UserProfile,
ReportModel, UTopic, Issue)
from .models.utils import send_mail
class UTopicForm(forms.ModelForm):
class Meta:... | true | true |
f705a73863c89acb45d5d05655334e8f3a3a5738 | 219 | py | Python | python/tdd/math/prime.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | 1 | 2021-08-19T13:40:26.000Z | 2021-08-19T13:40:26.000Z | python/tdd/math/prime.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | null | null | null | python/tdd/math/prime.py | xanderyzwich/Playground | 3c8bbfc33383f7ac1c88c2093fbe096cc2c44c3a | [
"Apache-2.0"
] | 1 | 2021-03-31T12:37:14.000Z | 2021-03-31T12:37:14.000Z | from math import ceil, sqrt
def my_sqrt(input_num):
return ceil(sqrt(input_num))
def is_divisible(dividend, divisor):
return dividend % divisor == 0
def is_prime(input_num):
return True
| 14.6 | 37 | 0.666667 | from math import ceil, sqrt
def my_sqrt(input_num):
return ceil(sqrt(input_num))
def is_divisible(dividend, divisor):
return dividend % divisor == 0
def is_prime(input_num):
return True
| true | true |
f705a7e2c833ec94fe1fa23667a30b153375cf95 | 55 | py | Python | pymatgen/phonon/__init__.py | cajfisher/pymatgen | 286c304e38102d567723a71f733e0c304b72035d | [
"MIT"
] | 921 | 2015-01-25T22:17:05.000Z | 2022-03-27T20:58:38.000Z | pymatgen/phonon/__init__.py | cajfisher/pymatgen | 286c304e38102d567723a71f733e0c304b72035d | [
"MIT"
] | 1,631 | 2015-01-05T21:05:04.000Z | 2022-03-31T18:40:17.000Z | pymatgen/phonon/__init__.py | cajfisher/pymatgen | 286c304e38102d567723a71f733e0c304b72035d | [
"MIT"
] | 851 | 2015-01-01T17:38:00.000Z | 2022-03-31T02:14:07.000Z | """
Phonon DOS and bandstructure analysis package.
"""
| 13.75 | 46 | 0.727273 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.