hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72734b87340580ae862b0b1ab93d1933cead503 | 608 | py | Python | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | 100_days_of_code/Beginner/day_13/art.py | Tiago-S-Ribeiro/Python-Pro-Bootcamp | 20a82443fe2e6ee9040ecd9a03853e6c6346592c | [
"MIT"
] | null | null | null | logo = '''
______ __ __ _ __ __
/ ____/__ __ ___ _____ _____ / /_ / /_ ___ / | / /__ __ ____ ___ / /_ ___ _____
/ / __ / / / // _ \ / ___// ___/ / __// __ \ / _ \ / |/ // / / // __ `__ \ / __ \ / _ \ / ___/
/ /_/ // ... | 86.857143 | 193 | 0.238487 | logo = '''
______ __ __ _ __ __
/ ____/__ __ ___ _____ _____ / /_ / /_ ___ / | / /__ __ ____ ___ / /_ ___ _____
/ / __ / / / // _ \ / ___// ___/ / __// __ \ / _ \ / |/ // / / // __ `__ \ / __ \ / _ \ / ___/
/ /_/ // ... | true | true |
f72734c285abc83d4428383f1e1fdcf37a42b826 | 12,086 | py | Python | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | null | null | null | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | 261 | 2020-10-15T15:56:15.000Z | 2022-03-31T07:08:30.000Z | mergify_engine/web/root.py | v1v/mergify-engine | 21f63be9987740e1466459f966b186392a235051 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2019–2021 Mergify SAS
#
# 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... | 34.141243 | 84 | 0.663247 |
import collections
import typing
import aredis
import daiquiri
from datadog import statsd
import fastapi
import httpx
from starlette import requests
from starlette import responses
import voluptuous
from mergify_engine import config
from mergify_engine import github_events
from mergify_engine import gi... | true | true |
f72734f8171a2b98bdc2a9bd97576b05bb2e2d82 | 2,808 | py | Python | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/dns/dnstools/managed_zone/list.py | IsaacHuang/google-cloud-sdk | 52afa5d1a75dff08f4f5380c5cccc015bf796ca5 | [
"Apache-2.0"
] | 2 | 2020-07-25T05:03:06.000Z | 2020-11-04T04:55:57.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
"""'dns managed-zone list' command."""
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class List(base.Command):
... | 33.035294 | 80 | 0.668803 |
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class List(base.Command):
DEFAULT_MAX_RESULTS = 0
DEFAULT_PAGE_SIZE = 1000
@staticmethod
def Args(parser)... | true | true |
f727357192760291f5ec1451349246fa4f2c9de9 | 1,168 | py | Python | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | null | null | null | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | 2 | 2021-06-08T19:37:11.000Z | 2022-03-11T23:40:45.000Z | flask_blog/users/utils.py | dungnv2602/flask_blog_showcase | 9508518f30923363b20045640219db5722a7416e | [
"MIT"
] | null | null | null | import os
import secrets
from PIL import Image
from flask_blog import mail
from flask_mail import Message
from flask import current_app, url_for
def save_picture(form_picture):
random_hex = secrets.token_hex(8)
_, f_ext = os.path.splitext(form_picture.filename)
picture_fn = random_hex + f_ext
picture_... | 30.736842 | 95 | 0.69863 | import os
import secrets
from PIL import Image
from flask_blog import mail
from flask_mail import Message
from flask import current_app, url_for
def save_picture(form_picture):
random_hex = secrets.token_hex(8)
_, f_ext = os.path.splitext(form_picture.filename)
picture_fn = random_hex + f_ext
picture_... | true | true |
f72735920d716a47d9d08cd21dfcce0ddb872b79 | 18,672 | py | Python | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cpp_std_flags_test.py | ninjayash/conan | 00fbc925fde93a148abfbcebf236c6b4f2da0572 | [
"MIT"
] | null | null | null | import unittest
from conans.client.build.cppstd_flags import cppstd_default
from conans.test.utils.mocks import MockSettings
from conans.tools import cppstd_flag
def _make_cppstd_flag(compiler, compiler_version, cppstd=None, compiler_base=None):
settings = MockSettings({"compiler": compiler,
... | 61.827815 | 99 | 0.626767 | import unittest
from conans.client.build.cppstd_flags import cppstd_default
from conans.test.utils.mocks import MockSettings
from conans.tools import cppstd_flag
def _make_cppstd_flag(compiler, compiler_version, cppstd=None, compiler_base=None):
settings = MockSettings({"compiler": compiler,
... | true | true |
f72735cd87fa6d88c743eda60cd6425d8578a594 | 1,671 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/region_UG.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. UG metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=256, international_prefix='00[057]',
general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_length=(9,), poss... | 111.4 | 286 | 0.666068 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=256, international_prefix='00[057]',
general_desc=PhoneNumberDesc(national_number_pattern='\\d{9}', possible_length=(9,), possible_length_local_only=(5, 6, 7)),
fixed_line=PhoneNumbe... | true | true |
f72736523caea2797e8de3a4ae833839547bc926 | 2,559 | py | Python | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | 1 | 2021-05-23T16:08:41.000Z | 2021-05-23T16:08:41.000Z | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | null | null | null | patitasbackend/emailer/views.py | nahuelmol/patitas | 75815aa3b388a538f32395d93b1fa25d7fb6de1a | [
"MIT"
] | null | null | null | from django.shortcuts import render
import pickle
import os.path
import mimetypes
import base64
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from email.mime.image import MIMEImage
from email.mime.multipart import... | 28.752809 | 119 | 0.66315 | from django.shortcuts import render
import pickle
import os.path
import mimetypes
import base64
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from email.mime.image import MIMEImage
from email.mime.multipart import... | true | true |
f727369391ddd48ef41823994e2d66ef082c42f9 | 33,146 | py | Python | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | lingvo/jax/eval.py | ruomingp/lingvo | ba59e8c46471be77d5d3c48177f0f0dd8d5d44e9 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 42.010139 | 80 | 0.710221 |
import contextlib
import functools
import hashlib
import os
import time
from typing import List, Optional, Sequence
from absl import logging
import jax
from jax.experimental import maps
from jax.experimental import mesh_utils
from lingvo.jax import base_input
from lingvo.jax import base_layer
from ling... | true | true |
f72737182c2d3650ddf80bd690d0f8357d6c3fc4 | 6,681 | py | Python | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | 1 | 2021-10-06T09:25:18.000Z | 2021-10-06T09:25:18.000Z | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | 1 | 2019-04-25T07:12:14.000Z | 2019-04-25T07:12:14.000Z | tests/api/v2/managers/test_config_api_manager.py | malached/caldera | b622b0b8d0a04bcd0328040cbf53a01b93505afc | [
"Apache-2.0"
] | null | null | null | import pytest
from app.api.v2 import errors
from app.api.v2.managers import config_api_manager
from app.api.v2.managers.config_api_manager import ConfigApiManager, ConfigNotFound, ConfigUpdateNotAllowed
from app.utility.base_world import BaseWorld
class StubDataService:
def __init__(self,):
self.abilitie... | 31.514151 | 108 | 0.68822 | import pytest
from app.api.v2 import errors
from app.api.v2.managers import config_api_manager
from app.api.v2.managers.config_api_manager import ConfigApiManager, ConfigNotFound, ConfigUpdateNotAllowed
from app.utility.base_world import BaseWorld
class StubDataService:
def __init__(self,):
self.abilitie... | true | true |
f727385f21f2d811533cd0c665f73487b0a69b03 | 4,078 | py | Python | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 1 | 2017-07-10T21:44:39.000Z | 2017-07-10T21:44:39.000Z | salt/runners/git_pillar.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | null | null | null | """
Runner module to directly manage the git external pillar
"""
import logging
import salt.pillar.git_pillar
import salt.utils.gitfs
from salt.exceptions import SaltRunnerError
log = logging.getLogger(__name__)
def update(branch=None, repo=None):
"""
.. versionadded:: 2014.1.0
.. versionchanged:: 201... | 37.759259 | 85 | 0.620157 |
import logging
import salt.pillar.git_pillar
import salt.utils.gitfs
from salt.exceptions import SaltRunnerError
log = logging.getLogger(__name__)
def update(branch=None, repo=None):
ret = {}
for ext_pillar in __opts__.get("ext_pillar", []):
pillar_type = next(iter(ext_pillar))
if pillar_ty... | true | true |
f72738ce22a36dacc0601114240ea55abf166fad | 832 | py | Python | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 27 | 2020-05-01T01:45:59.000Z | 2020-07-03T00:17:13.000Z | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 34 | 2020-04-26T11:25:52.000Z | 2020-07-03T21:06:34.000Z | FreeTAKServer/controllers/SpecificCoTControllers/SendFederatedCoT.py | Tapawingo/FreeTakServer | 30259fa0fb5a69bbf6606f06d9cd40a63d2aa4fd | [
"MIT"
] | 15 | 2020-05-01T01:46:07.000Z | 2020-07-03T12:14:04.000Z | from FreeTAKServer.model.SpecificCoT.SendFederatedCoT import SendFederatedCoT
from .SendCoTAbstractController import SendCoTAbstractController
from FreeTAKServer.controllers.configuration.LoggingConstants import LoggingConstants
from FreeTAKServer.controllers.CreateLoggerController import CreateLoggerController
loggin... | 52 | 114 | 0.78125 | from FreeTAKServer.model.SpecificCoT.SendFederatedCoT import SendFederatedCoT
from .SendCoTAbstractController import SendCoTAbstractController
from FreeTAKServer.controllers.configuration.LoggingConstants import LoggingConstants
from FreeTAKServer.controllers.CreateLoggerController import CreateLoggerController
loggin... | true | true |
f7273915b911e2c9ab5a33795229deb37059132d | 22,981 | py | Python | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | Tools/scripts/freeze_modules.py | erickpeirson/cpython | d441437ee71ae174c008c23308b749b91020ba77 | [
"0BSD"
] | null | null | null | """Freeze modules and regen related files (e.g. Python/frozen.c).
See the notes at the top of Python/frozen.c for more info.
"""
from collections import namedtuple
import hashlib
import os
import ntpath
import posixpath
import platform
import subprocess
import sys
import textwrap
import time
from update_file import ... | 32.924069 | 93 | 0.591576 |
from collections import namedtuple
import hashlib
import os
import ntpath
import posixpath
import platform
import subprocess
import sys
import textwrap
import time
from update_file import updating_file_with_tmpfile, update_file_with_tmpfile
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
ROOT... | true | true |
f727392d301c086ac8d765cc7989c6df28dc7616 | 962 | py | Python | lockss_configuration/__init__.py | lockss/lockss-configuration-python | d645b42e0fdae5ccfcaf80b26c09218c1e1c9c94 | [
"BSD-3-Clause"
] | null | null | null | lockss_configuration/__init__.py | lockss/lockss-configuration-python | d645b42e0fdae5ccfcaf80b26c09218c1e1c9c94 | [
"BSD-3-Clause"
] | null | null | null | lockss_configuration/__init__.py | lockss/lockss-configuration-python | d645b42e0fdae5ccfcaf80b26c09218c1e1c9c94 | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
LOCKSS Configuration Service REST API
API of the LOCKSS Configuration REST Service # noqa: E501
OpenAPI spec version: 1.0.0
Contact: lockss-support@lockss.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolut... | 32.066667 | 91 | 0.828482 |
"""
LOCKSS Configuration Service REST API
API of the LOCKSS Configuration REST Service # noqa: E501
OpenAPI spec version: 1.0.0
Contact: lockss-support@lockss.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
from lockss_config... | false | true |
f72739fb303514524a1f36a098a48adc38f45626 | 4,753 | py | Python | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | 1 | 2020-12-03T01:34:47.000Z | 2020-12-03T01:34:47.000Z | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | null | null | null | explain.py | pakesson/scaml | c69d422d6839d75a81426c81fd8d570fa421744b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import math
import numpy as np
from tensorflow.keras.models import load_model
from aes import aes_sbox, aes_sbox_inv
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def get_label(plaintext, key, index):
return aes_sbox[plaintext[index] ^ key[index]]
n... | 36.007576 | 138 | 0.708605 |
import sys
import math
import numpy as np
from tensorflow.keras.models import load_model
from aes import aes_sbox, aes_sbox_inv
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
def get_label(plaintext, key, index):
return aes_sbox[plaintext[index] ^ key[index]]
num_classes = 256
atta... | true | true |
f7273a7b5d7bdf69557a4052a69a66f7ebffb3ac | 588 | py | Python | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | stats/attendance.py | diegomrsantos/Python-Baseball | 4543df7a4d74e82106a3e8481553149c447d8ab6 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from data import games
info_filter = games['type'] == 'info'
attendance_filter = games['multi2'] == 'attendance'
attendance = games.loc[info_filter & attendance_filter, ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] ... | 32.666667 | 91 | 0.710884 | import pandas as pd
import matplotlib.pyplot as plt
from data import games
info_filter = games['type'] == 'info'
attendance_filter = games['multi2'] == 'attendance'
attendance = games.loc[info_filter & attendance_filter, ['year', 'multi3']]
attendance.columns = ['year', 'attendance']
attendance.loc[:, 'attendance'] ... | true | true |
f7273aa823161ba436cb65218833b108a92b9ccc | 651 | py | Python | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | null | null | null | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | 2 | 2022-01-23T18:51:13.000Z | 2022-01-23T18:54:36.000Z | tests/test_pickling_in_main/main.py | smheidrich/pickle-spree | 73d7a6fd1265f28fc3b91db593309cf5d2ae9195 | [
"MIT"
] | null | null | null | from collections import ChainMap
import os
from pathlib import Path
from pickle_spree import PopenFactory
import subprocess
import sys
class CallableDefinedInMain:
def __call__(self):
return 1
callable = CallableDefinedInMain()
new_popen = PopenFactory(callable=callable)
subprocess.Popen = new_popen
pythonpa... | 25.038462 | 74 | 0.752688 | from collections import ChainMap
import os
from pathlib import Path
from pickle_spree import PopenFactory
import subprocess
import sys
class CallableDefinedInMain:
def __call__(self):
return 1
callable = CallableDefinedInMain()
new_popen = PopenFactory(callable=callable)
subprocess.Popen = new_popen
pythonpa... | true | true |
f7273b4fd11cad1a9484b1fbcd350c2e7b6f9e26 | 377 | py | Python | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | Exercicio6TapeEquilibrium/ResolucaoPropria/start.py | GRParasky/codility-exercises | 1a7144492d78fd712ec8d23d94502e3f5ed642a3 | [
"MIT"
] | null | null | null | def solution(A):
list_range = len(A)
difference_list = []
for p in range(1, list_range):
post_sum = sum(A[p:])
behind_sum = sum(A[:p])
difference = behind_sum - post_sum
if difference < 0:
difference *= -1
difference_list.append(difference)
retur... | 18.85 | 42 | 0.572944 | def solution(A):
list_range = len(A)
difference_list = []
for p in range(1, list_range):
post_sum = sum(A[p:])
behind_sum = sum(A[:p])
difference = behind_sum - post_sum
if difference < 0:
difference *= -1
difference_list.append(difference)
retur... | true | true |
f7273bbbd5fff48873e854018e8ac2d206d735b8 | 12,117 | py | Python | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | 1 | 2020-12-20T03:45:04.000Z | 2020-12-20T03:45:04.000Z | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | null | null | null | .github/scripts/check-header.py | githubliweichao/FreeRTOS | 208b260f982d7a0c8b9aaff6bc446f8c7e45d2e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os, sys, re
from argparse import ArgumentParser
from difflib import unified_diff
from json import load
def dprint(msg):
print('[DEBUG]: %s' % str(msg))
class HeaderChecker:
def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]):
s... | 25.035124 | 116 | 0.505241 |
import os, sys, re
from argparse import ArgumentParser
from difflib import unified_diff
from json import load
def dprint(msg):
print('[DEBUG]: %s' % str(msg))
class HeaderChecker:
def __init__(self, header, padding=1000, ignored_files=[], ignored_ext=[], ignored_patterns=[]):
self.padding = padding
... | true | true |
f7273bc9f69a30526a9b3eca4ec533b0eff5edfe | 11,534 | py | Python | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | 1 | 2022-03-30T07:50:10.000Z | 2022-03-30T07:50:10.000Z | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | null | null | null | evaluate/evaluate_FDR.py | rperi/trustworthy-asv-fairness | 15df69a8f3f8ad5262002c9e3d12aa12ea8f1c6f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import os
import pdb
from scipy.spatial.distance import cosine
from sklearn.metrics import roc_curve, confusion_matrix
import sys
from tqdm import tqdm
from sklearn.metrics import auc
import argparse
fprs = [0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4,0.5]
groups... | 46.321285 | 216 | 0.658401 | import numpy as np
import pandas as pd
import os
import pdb
from scipy.spatial.distance import cosine
from sklearn.metrics import roc_curve, confusion_matrix
import sys
from tqdm import tqdm
from sklearn.metrics import auc
import argparse
fprs = [0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4,0.5]
groups... | true | true |
f7273c1bf115cb1687982e0d1e6f9de4ff2abedf | 11,677 | py | Python | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | com/precisely/apis/model/individual_value_variable.py | PreciselyData/PreciselyAPIsSDK-Python | 28ffff0c96d81d3a53a5599c987d54d7b632b508 | [
"Apache-2.0"
] | null | null | null | """
Precisely APIs
Enhance & enrich your data, applications, business processes, and workflows with rich location, information, and identify APIs. # noqa: E501
The version of the OpenAPI document: 11.9.3
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F4... | 43.570896 | 145 | 0.565899 |
import re
import sys
from com.precisely.apis.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 |
f7273c9914ccfd701d1ff364fe87e5615b331733 | 1,279 | py | Python | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | 3 | 2015-06-12T04:42:02.000Z | 2018-10-29T17:09:10.000Z | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | null | null | null | ownblock/ownblock/apps/notices/migrations/0001_initial.py | danjac/ownblock | ac662fb7efb2f04567e2f85638c1250286452611 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('buildings', '__first__'),
migrations.swappabl... | 36.542857 | 147 | 0.620797 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('buildings', '__first__'),
migrations.swappable_dependency(settings.A... | true | true |
f7273d2cdf1526800b8a09c10a36d9eb9438cb1e | 333 | py | Python | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | Exercicios/Desafio033.py | victorhugof94/Python | 8b42955634f3ae44bded350ac88396a02b1f6970 | [
"MIT"
] | null | null | null | n1 = int(input('primeiro numero:'))
n2 = int(input('segundo numero:'))
n3 = int(input('terceiro numero:'))
menor = n1
if n2<n1 and n2<n3:
menor=n2
if n3<n1 and n3<n2:
menor=n3
maior = n1
if n2>n1 and n2>n3:
maior=n2
if n3>n1 and n3>n2:
maior=n3
print ('menor = {}'.format(menor))
print ('maior = {}'.f... | 18.5 | 35 | 0.621622 | n1 = int(input('primeiro numero:'))
n2 = int(input('segundo numero:'))
n3 = int(input('terceiro numero:'))
menor = n1
if n2<n1 and n2<n3:
menor=n2
if n3<n1 and n3<n2:
menor=n3
maior = n1
if n2>n1 and n2>n3:
maior=n2
if n3>n1 and n3>n2:
maior=n3
print ('menor = {}'.format(menor))
print ('maior = {}'.f... | true | true |
f7273d39afe2ba8bd90bcbf4e85702e9d6bb3817 | 43,399 | py | Python | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 46 | 2018-04-06T19:54:32.000Z | 2022-02-08T02:00:02.000Z | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 474 | 2018-04-05T22:21:09.000Z | 2022-02-24T14:21:16.000Z | podpac/core/coordinates/test/test_uniform_coordinates1d.py | creare-com/podpac | 7feb5c957513c146ce73ba1c36c630284f513a6e | [
"Apache-2.0"
] | 4 | 2019-04-11T17:49:53.000Z | 2020-11-29T22:36:53.000Z | from datetime import datetime
import json
import pytest
import traitlets as tl
import numpy as np
from numpy.testing import assert_equal
import podpac
from podpac.core.coordinates.utils import make_coord_array
from podpac.core.coordinates.coordinates1d import Coordinates1d
from podpac.core.coordinates.array_coordinat... | 34.999194 | 111 | 0.57446 | from datetime import datetime
import json
import pytest
import traitlets as tl
import numpy as np
from numpy.testing import assert_equal
import podpac
from podpac.core.coordinates.utils import make_coord_array
from podpac.core.coordinates.coordinates1d import Coordinates1d
from podpac.core.coordinates.array_coordinat... | true | true |
f7273dd94996a596fd89b435c509524733c41b42 | 4,323 | py | Python | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | lyft_CNN.py | govindap/lyft_motion_prediction | 15412444fec69ce4a0082d8de730cb882833eab0 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision.models.resnet import resnet50, resnet34
from torch import Tensor
from typing import Dict
from l5kit.configs import load_config_data
from l5kit.data import LocalDataManager, ChunkedDataset
from l5kit.dat... | 31.100719 | 101 | 0.635901 | import numpy as np
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision.models.resnet import resnet50, resnet34
from torch import Tensor
from typing import Dict
from l5kit.configs import load_config_data
from l5kit.data import LocalDataManager, ChunkedDataset
from l5kit.dat... | true | true |
f7273e61673d7705a50b7baced2d412d3ccc1539 | 167 | py | Python | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | backend/course_application/apps.py | heyImDrew/edupro | 98b8342dda45071da4871bbf73f2ef002fee938f | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class CourseApplicationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'course_application'
| 23.857143 | 56 | 0.790419 | from django.apps import AppConfig
class CourseApplicationConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'course_application'
| true | true |
f7273e63342dcead5dd52298df0ffc0e7b2d6ce6 | 41 | py | Python | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/mail_client_extension/controllers/__init__.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*
from . import main | 20.5 | 22 | 0.585366 |
from . import main | true | true |
f7273ea22419d001ae46764df21f035e585f8246 | 1,368 | py | Python | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 7 | 2015-05-09T20:31:36.000Z | 2021-05-17T02:14:30.000Z | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 5 | 2016-05-31T22:15:08.000Z | 2021-02-16T08:44:28.000Z | gitflow/util.py | chassing/gitflow | 722ec6a68165bac80443eecf97bd00b8f7818b50 | [
"BSD-3-Clause"
] | 10 | 2016-05-31T21:41:25.000Z | 2021-04-11T13:33:48.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
#
# Shamelessly ripped from
# http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/
#
def itersubclasses(cls, _seen=None):
"""
itersubclasses(cls)
... | 27.36 | 82 | 0.57383 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
def itersubclasses(cls, _seen=None):
if not isinstance(cls, type):
raise TypeError('itersubclasses must be called with '
'new-style classes, not %.100r' % cls)
if ... | true | true |
f7273ee822a983a7b06727171c767b66a9c5a749 | 1,054 | py | Python | tests/functional/test_hooks/test_six.py | yoda-vid/pyinstaller | 419f349dad721a253b19d9c596e251818132d6ba | [
"Apache-2.0"
] | 2 | 2017-02-08T22:22:09.000Z | 2020-10-08T12:28:36.000Z | tests/functional/test_hooks/test_six.py | 416426/pyinstaller | 0f2b2e921433ab5a510c7efdb21d9c1d7cfbc645 | [
"Apache-2.0"
] | 3 | 2020-04-06T15:48:37.000Z | 2021-03-23T10:22:21.000Z | tests/functional/test_hooks/test_six.py | 416426/pyinstaller | 0f2b2e921433ab5a510c7efdb21d9c1d7cfbc645 | [
"Apache-2.0"
] | 4 | 2018-06-04T20:40:37.000Z | 2020-10-13T22:38:40.000Z | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2021, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is... | 34 | 78 | 0.627135 |
from PyInstaller.utils.tests import importorskip
@importorskip('six.moves')
def test_six_moves(pyi_builder):
pyi_builder.test_source(
"""
from six.moves import UserList
UserList
""")
@importorskip('six.moves')
def test_six_moves_2nd_run(pyi_builder):
return tes... | true | true |
f7273f7676d92413f9cd5cae85de640904f6032a | 8,163 | py | Python | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/concurrent_record/put_game_record_concurrent_handler_v1.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | # Auto-generated at 2021-09-27T17:01:31.256010+08:00
# from: Justice Cloudsave Service (3.38.0)
# Copyright (c) 2018 - 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
# pylint: disable=duplicate-code
# p... | 30.233333 | 137 | 0.61987 |
from __future__ import annotations
from typing import Any, Dict, List, Optional, Tuple, Union
from .....core import Operation
from .....core import HttpResponse
from ...models import ModelsConcurrentRecordRequest
from ...models import ResponseError
class PutGameRecordConcurrentHandlerV1(Operati... | true | true |
f72740045bcd8582e8aa4a06002d0eadbb562489 | 2,739 | py | Python | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | main.py | sem-onyalo/gan-textures | ed75ce150d98920bf0d1f0a00ff42d3992c0e32e | [
"MIT"
] | null | null | null | import argparse
import logging
from model import DCGAN_1024
def init_logger():
logging.basicConfig(
format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s",
datefmt="%Y/%m/%d %H:%M:%S",
level=logging.INFO
)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pa... | 38.577465 | 81 | 0.680175 | import argparse
import logging
from model import DCGAN_1024
def init_logger():
logging.basicConfig(
format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s",
datefmt="%Y/%m/%d %H:%M:%S",
level=logging.INFO
)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
pa... | true | true |
f727406dcaa18843458f6c479462d8f14bb82493 | 2,802 | py | Python | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | DLCoursera_part1_week4_1.py | zhouhan921001/DeepLearning-homework | 20562dc49ca5898b531a678c0e54c8d985fcc72f | [
"MIT"
] | null | null | null | import numpy as np
from dnn_utils import sigmoid,sigmoid_backward,relu,relu_backward
def initialize_two_layer(n_x,n_h,n_y):
W1 = np.random.randn(n_h,n_x) * 0.01
b1 = np.zeros(n_h,1)
W2 = np.random.randn(n_y,n_h) * 0.01
b2 = np.zeros(n_y,1)
param = {"W1":W1,"b1":b1,"W2":W2,"b2":b2}
return param
def initialize... | 22.062992 | 115 | 0.662384 | import numpy as np
from dnn_utils import sigmoid,sigmoid_backward,relu,relu_backward
def initialize_two_layer(n_x,n_h,n_y):
W1 = np.random.randn(n_h,n_x) * 0.01
b1 = np.zeros(n_h,1)
W2 = np.random.randn(n_y,n_h) * 0.01
b2 = np.zeros(n_y,1)
param = {"W1":W1,"b1":b1,"W2":W2,"b2":b2}
return param
def initialize... | true | true |
f727406ebc3243dcb2438e089040b82a0966c25b | 9,078 | py | Python | examples/adwords/v201702/extensions/add_site_links_using_feeds.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201702/extensions/add_site_links_using_feeds.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201702/extensions/add_site_links_using_feeds.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 38.303797 | 81 | 0.649372 |
"""This example adds a sitelinks feed and associates it with a campaign.
To add sitelinks using the simpler ExtensionSetting services, see:
add_sitelinks.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
d... | false | true |
f727409d08bf28ed9c3b7b788835af2b38189f4f | 15,624 | py | Python | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | word2vec_basic.py | rmodi6/word-representations | 4f9a13cee9ff60ce3c667c833330b59de774ed39 | [
"MIT"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.467626 | 113 | 0.662186 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
import os, sys
import random
import zipfile
import numpy as np
from six.moves import urllib
from six.moves import xrange
import tensorflow as tf
import loss_func... | true | true |
f7274148a77ac245be2e506c83b47f5520833782 | 2,404 | py | Python | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"Apache-2.0"
] | null | null | null | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"Apache-2.0"
] | null | null | null | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/util/asyncscheduledtask.py | gayangunarathne/private-paas | d4dd794a7dcf46312d17e81fe0442e42d30c8c63 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.931507 | 110 | 0.669301 |
import time
from threading import Thread
class AbstractAsyncScheduledTask:
def execute_task(self):
raise NotImplementedError
class ScheduledExecutor(Thread):
def __init__(self, delay, task):
Thread.__init__(self)
self.delay = delay
self.task = task
... | true | true |
f727415cbcd7b0a3044c71aebd591a61b3989d00 | 393 | py | Python | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | null | null | null | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | null | null | null | techtest/asgi.py | rising-entropy/Techcurve-Test | eeefd14d1a83451b9b5333f582ed6cc12efca44c | [
"MIT"
] | 1 | 2021-03-26T11:39:15.000Z | 2021-03-26T11:39:15.000Z | """
ASGI config for techtest project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techtest.settings')
application = get_asgi_application()
| true | true |
f72741a466183d81d1fca4196b837b1a9535f959 | 6,357 | py | Python | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | read_xml_all/calcul_matrix_compare_ce_good_192matrix.py | daniel20162016/my-first | f9554dd476302b26e8a296393025f150922f349c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 31 15:45:22 2016
@author: wang
"""
#from matplotlib import pylab as plt
#from numpy import fft, fromstring, int16, linspace
#import wave
from read_wav_xml_good_1 import*
from matrix_24_2 import*
from max_matrix_norm import*
import numpy as np
# open a wave file
filename... | 39.240741 | 147 | 0.532012 |
from read_wav_xml_good_1 import*
from matrix_24_2 import*
from max_matrix_norm import*
import numpy as np
filename = 'francois_filon_pure_3.wav'
filename_1 ='francois_filon_pure_3.xml'
word ='ce'
wave_signal_float,framerate, word_start_point, word_length_point, word_end_point= read_wav_xml_good_1(filename,filen... | true | true |
f7274274d7a0048e67b5610c186be3f936227e5f | 1,037 | py | Python | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | 3 | 2022-03-23T19:16:25.000Z | 2022-03-30T18:12:19.000Z | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | null | null | null | debussy_concert/data_ingestion/config/movement_parameters/time_partitioned.py | DotzInc/debussy_concert | a28d7ca01814f24ffa75cfece758d619b71509f2 | [
"Apache-2.0"
] | 1 | 2022-03-23T20:14:48.000Z | 2022-03-23T20:14:48.000Z | from dataclasses import dataclass
from debussy_concert.core.config.movement_parameters.base import MovementParametersBase
@dataclass(frozen=True)
class BigQueryDataPartitioning:
partitioning_type: str
gcs_partition_schema: str
partition_field: str
destination_partition: str
@dataclass(frozen=True)
c... | 34.566667 | 87 | 0.802314 | from dataclasses import dataclass
from debussy_concert.core.config.movement_parameters.base import MovementParametersBase
@dataclass(frozen=True)
class BigQueryDataPartitioning:
partitioning_type: str
gcs_partition_schema: str
partition_field: str
destination_partition: str
@dataclass(frozen=True)
c... | true | true |
f72742b11c9975baf67b3cee27f9d5f9ddcb878a | 1,593 | py | Python | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | null | null | null | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | null | null | null | userbot/plugins/instastory_x3.py | x3raqee/x3raqe | d062ace8d69895a8ab80a003fc76da63e2b63a1d | [
"Apache-2.0"
] | 1 | 2021-04-27T23:28:43.000Z | 2021-04-27T23:28:43.000Z | # @x3raqe
#ممول محمد
"""QuotLy: Avaible commands: .انستا
"""
import datetime
import asyncio
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from userbot.utils import admin_cmd
@borg.on(admin_cmd... | 37.046512 | 102 | 0.629002 |
import datetime
import asyncio
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from userbot.utils import admin_cmd
@borg.on(admin_cmd(pattern="ستوري ?(.*)"))
async def _(event):
if event.fwd_... | true | true |
f72743000a24fcbc0e4390eb46261f96678ebe0b | 956 | py | Python | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/vod/models/UpdateTranscodeTemplateGroupReqData.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 31.866667 | 75 | 0.722803 |
class UpdateTranscodeTemplateGroupReqData(object):
def __init__(self, groupName=None, templates=None):
self.groupName = groupName
self.templates = templates
| true | true |
f72743d6ec89246b1658151bdccfda8fc5b489b1 | 8,498 | py | Python | docs/conf.py | Akhail/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 5 | 2017-09-20T02:12:25.000Z | 2019-10-22T14:12:07.000Z | docs/conf.py | mdbetancourt/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 3 | 2021-06-14T14:20:53.000Z | 2021-11-15T17:47:37.000Z | docs/conf.py | Akhail/Tebless | 87faff5547f168d0cf2d5caaf313c1efe1c19950 | [
"MIT"
] | 1 | 2021-04-13T14:03:53.000Z | 2021-04-13T14:03:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tebless documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 30.6787 | 76 | 0.717581 |
import sys
import os
import sphinx_rtd_theme
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import tebless
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = '... | true | true |
f72744a63d45a288c51ef43928f1452981437cd1 | 2,703 | py | Python | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | 1 | 2021-05-03T02:03:36.000Z | 2021-05-03T02:03:36.000Z | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | null | null | null | snake.py | leonardoarthur/SnakeGame | 106d3d238fd0d15091aa25d1770886961cedcc73 | [
"MIT"
] | null | null | null | import pygame
import random
pygame.init()
azul = (50, 100, 213)
laranja = (205, 102, 0)
verde = (0, 255, 0)
amarelo = (255, 255, 102)
dimensoes = (600, 600)
x = 300
y = 300
d = 20
lista_cobra = [[x, y]]
dx = 0
dy = 0
x_comida = round(random.randrange(0, 600 - d) /20) * 20
y_comida = round(random.randrange(0, 60... | 24.572727 | 94 | 0.607103 | import pygame
import random
pygame.init()
azul = (50, 100, 213)
laranja = (205, 102, 0)
verde = (0, 255, 0)
amarelo = (255, 255, 102)
dimensoes = (600, 600)
x = 300
y = 300
d = 20
lista_cobra = [[x, y]]
dx = 0
dy = 0
x_comida = round(random.randrange(0, 600 - d) /20) * 20
y_comida = round(random.randrange(0, 60... | true | true |
f7274749a010a84dccc4f71883f73ec4a8832b8a | 417 | py | Python | glitter/migrations/0004_object_id_required.py | dhamaniasad/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 3 | 2017-06-01T16:22:18.000Z | 2018-08-22T21:45:55.000Z | glitter/migrations/0004_object_id_required.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 85 | 2016-02-25T10:34:03.000Z | 2017-04-03T11:07:59.000Z | glitter/migrations/0004_object_id_required.py | blancltd/django-glitter | b9b0a3d8b49d5d9b840656f84564ba0a6e016f98 | [
"BSD-3-Clause"
] | 1 | 2016-08-02T08:21:19.000Z | 2016-08-02T08:21:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('glitter', '0003_remove_empty_contentblocks'),
]
operations = [
migrations.AlterField(
model_name='contentblock',... | 20.85 | 55 | 0.621103 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('glitter', '0003_remove_empty_contentblocks'),
]
operations = [
migrations.AlterField(
model_name='contentblock',
name='obje... | true | true |
f72747c52a599d07bf9a7350a23de712aeb51d69 | 3,190 | py | Python | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | app/result/views.py | Ravishrks/examin | 974f8d86ca116b3135a482e8e81532a40ea187c3 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views import View
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponse
from result.models import ResponseSheet
import os
im... | 34.673913 | 156 | 0.601254 | from django.shortcuts import render, redirect
from django.views import View
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponse
from result.models import ResponseSheet
import os
im... | true | true |
f727483e267d49216f2db46205941f51cd603a86 | 544 | py | Python | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | 1 | 2019-02-03T17:17:02.000Z | 2019-02-03T17:17:02.000Z | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | null | null | null | src/manage.py | tegarty/socialrating | b80888ee8e637bd0a5517614c78235d563fead2e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialrating.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django.... | 34 | 76 | 0.689338 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'socialrating.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's in... | true | true |
f7274a0d65eb66f00c4a41033040a9f2ae9f8cac | 18,672 | py | Python | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | null | null | null | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | null | null | null | autobahn/wamp/interfaces.py | meejah/AutobahnPython | 54da8882eea3f4b1da62a6d3481556ab77720d41 | [
"MIT"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | 37.569416 | 106 | 0.658044 | true | true | |
f7274b9a30433a0e80ac0f1cf680738f5e8edb50 | 20,559 | py | Python | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | 1 | 2020-11-25T17:52:53.000Z | 2020-11-25T17:52:53.000Z | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | null | null | null | PyDSS/pyPostprocessor/PostprocessScripts/DERMSOptimizer_helper_modules/opt_funcs.py | daniel-thom/PyDSS | 8c7ae2d3a17d596b42a92e33f7d29329e26fbc30 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T19:52:02.000Z | 2020-07-23T19:52:02.000Z | import numpy as np
from scipy.sparse import lil_matrix
import scipy.sparse.linalg as sp
import scipy.sparse as sparse
import math
import csv
import matplotlib.pyplot as plt
def linear_powerflow_model(Y00,Y01,Y10,Y11_inv,I_coeff,V1,slack_no):
# voltage linearlization
V1_conj = np.conj(V1[slack_no:])
V1_conj... | 45.686667 | 182 | 0.555329 | import numpy as np
from scipy.sparse import lil_matrix
import scipy.sparse.linalg as sp
import scipy.sparse as sparse
import math
import csv
import matplotlib.pyplot as plt
def linear_powerflow_model(Y00,Y01,Y10,Y11_inv,I_coeff,V1,slack_no):
V1_conj = np.conj(V1[slack_no:])
V1_conj_inv = 1 / V1_conj
c... | true | true |
f7274bbaa9b6a7c957dcc7b0ce646d02630be40a | 956 | py | Python | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | null | null | null | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | 2 | 2020-06-23T13:57:20.000Z | 2022-02-09T23:39:15.000Z | link_lang_spacy.py | bothub-it/bothub-nlp-ai-platform | 94f1fae57b8e81ed5f71839df6d47b1ee0df53f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import plac
import importlib
from pathlib import Path
from spacy.util import get_package_path
from spacy.compat import symlink_to
@plac.annotations(
lang=plac.Annotation(help='Language code'),
lang_path=plac.Annotation(help='Language path'))
def link_lang_spacy(lang... | 25.157895 | 75 | 0.623431 |
import os
import sys
import plac
import importlib
from pathlib import Path
from spacy.util import get_package_path
from spacy.compat import symlink_to
@plac.annotations(
lang=plac.Annotation(help='Language code'),
lang_path=plac.Annotation(help='Language path'))
def link_lang_spacy(lang, lang_path):
ori... | true | true |
f7274bcbf40683a5d160d96b2f06a72cde94327d | 4,927 | py | Python | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 1 | 2020-12-29T16:00:13.000Z | 2020-12-29T16:00:13.000Z | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 8 | 2020-12-08T23:20:01.000Z | 2021-01-28T22:23:22.000Z | backend/DankiBackEnd/settings.py | danielpassy/Translang-Deck | 60057dd4eecc929682bb5d154656380b05d040c5 | [
"MIT"
] | 1 | 2020-12-08T23:38:49.000Z | 2020-12-08T23:38:49.000Z | """
Django settings for DankiBackEnd project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from path... | 26.632432 | 114 | 0.635681 |
from pathlib import Path
from os import path, getcwd
import os
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
SECRET_KEY = os.environ.get(
"SECRET_KEY", "(ac&ri0xuv9_!o#$$=$g#po&mkasdasdqwejqpoweaqaky-glk+vi^^!ka9f8%+$7"
)
DEBUG = True
ALLOWED_HOSTS = ["translang.live", "www.translang.live... | true | true |
f7274bf22c6d405fafa87ecd7084bc1ec5559d84 | 4,583 | py | Python | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | examples/amac/fund_spider.py | acracker/ruia | b973a47270f72cc16344ac203c00ee4f6d835c04 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-01-17 13:49
# @Author : pang
# @File : fund.py
# @Software: PyCharm
import datetime
import os
import asyncio
import re
import logging
import time
import random
import aiohttp
from motor.motor_asyncio import AsyncIOMotorClient
from ruia import Request... | 40.201754 | 157 | 0.592625 |
import datetime
import os
import asyncio
import re
import logging
import time
import random
import aiohttp
from motor.motor_asyncio import AsyncIOMotorClient
from ruia import Request, Spider, Response
try:
from items import FundInfoItemV1
from settings import *
except ImportError:
import sys
sy... | true | true |
f7274c9f9d6c7bc1762947fcfb7aab6dfe8470bc | 687 | py | Python | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | profiles/models.py | Samyak-jain09/QnA | 5044a947b84834cfc36554053a18cc1b12ad0f0e | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from sorl.thumbnail import ImageField
# Create your models here.
class Profile(models.Model):
user= models.OneToOneField(
User,
on... | 24.535714 | 62 | 0.672489 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from sorl.thumbnail import ImageField
class Profile(models.Model):
user= models.OneToOneField(
User,
on_delete=models.CASCADE,
... | true | true |
f7274dc7c0bed6089595d1474055de95254fbc71 | 13,661 | py | Python | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | null | null | null | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | 1 | 2019-12-30T19:30:01.000Z | 2019-12-30T19:30:29.000Z | pyzombie/Handler.py | lanhel/pyzombie | dba35d98152e5d99d4231ab9124727ae47b3bf72 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""pyzombie HTTP RESTful resource handler."""
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0.1'
__copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)"""
__license__ = ... | 33.982587 | 109 | 0.566284 |
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0.1'
__copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)"""
__license__ = """
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 ... | true | true |
f7274e486eedd05c1c6a0c85be46f9c9e766ce1c | 1,073 | py | Python | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | 1 | 2019-06-05T16:05:28.000Z | 2019-06-05T16:05:28.000Z | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | null | null | null | SimpleShadowsocksSubscribeServer/views/subscribe.py | TomCzHen/py4S | c07b0a05c798809ef95e8ef47e87c877b82358fd | [
"MIT"
] | null | null | null | import uuid
from sanic import response
from sanic.exceptions import abort
from sanic.request import Request
from sanic.views import HTTPMethodView as SanicHTTPView
from ..cache import cache
class SubscribeView(SanicHTTPView):
async def get(self, request: Request, uid: uuid):
token = request.args.get('t... | 26.825 | 82 | 0.59739 | import uuid
from sanic import response
from sanic.exceptions import abort
from sanic.request import Request
from sanic.views import HTTPMethodView as SanicHTTPView
from ..cache import cache
class SubscribeView(SanicHTTPView):
async def get(self, request: Request, uid: uuid):
token = request.args.get('t... | true | true |
f7274e9c19524a8d036639345aeb06261fec049e | 5,177 | py | Python | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 262 | 2018-08-09T21:27:03.000Z | 2022-03-24T05:02:10.000Z | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 753 | 2018-08-03T15:26:57.000Z | 2022-03-29T23:54:48.000Z | tests/unit_tests/test_data_photon.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 196 | 2018-08-06T13:41:14.000Z | 2022-03-29T20:47:12.000Z | #!/usr/bin/env python
from collections.abc import Mapping, Callable
import os
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import openmc.data
@pytest.fixture(scope='module')
def elements_endf():
"""Dictionary of element ENDF data indexed by atomic symbol."""
endf_data = os.e... | 33.836601 | 85 | 0.66525 |
from collections.abc import Mapping, Callable
import os
from pathlib import Path
import numpy as np
import pandas as pd
import pytest
import openmc.data
@pytest.fixture(scope='module')
def elements_endf():
endf_data = os.environ['OPENMC_ENDF_DATA']
elements = {'H': 1, 'O': 8, 'Al': 13, 'Cu': 29, 'Ag': 47, ... | true | true |
f7274ee40debdeaa4b9393203cab8d398b64d837 | 756 | py | Python | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | v_python/conftest.py | spcartman/selenium_full_course | 673f25dcf2340c0c14666c7a91f774fd7659f0b1 | [
"MIT"
] | null | null | null | import pytest
import json
from os import path
from fixture.fixture import Fixture
with open(path.join(path.dirname(path.abspath(__file__)), 'config.json')) as f:
config = json.load(f)
@pytest.fixture(scope="session")
def app(request):
fixture = Fixture(admin_root=config['admin']['url'],
... | 34.363636 | 79 | 0.611111 | import pytest
import json
from os import path
from fixture.fixture import Fixture
with open(path.join(path.dirname(path.abspath(__file__)), 'config.json')) as f:
config = json.load(f)
@pytest.fixture(scope="session")
def app(request):
fixture = Fixture(admin_root=config['admin']['url'],
... | true | true |
f7275019da64b65a5d33210b547cf8cc8acaac87 | 1,094 | py | Python | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | 3 | 2016-03-16T03:11:01.000Z | 2016-12-31T06:20:57.000Z | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | 6 | 2018-06-12T12:40:22.000Z | 2018-06-18T09:46:46.000Z | bitoptions/widgets.py | amateja/django-bitoptions | 6e2d00d8b5d16c4a678a319c06313de6d2c75eda | [
"Unlicense"
] | null | null | null | from django import forms
from .utils import number2powers, BitOptions
class BitOptionsWidget(forms.CheckboxSelectMultiple):
"""
Default BitOptionsField widget to present every option (bit) as checkbox.
"""
def value_from_datadict(self, data, files, name):
"""
Given a dictionary of da... | 34.1875 | 79 | 0.606947 | from django import forms
from .utils import number2powers, BitOptions
class BitOptionsWidget(forms.CheckboxSelectMultiple):
def value_from_datadict(self, data, files, name):
return sum(map(int, super(BitOptionsWidget, self).value_from_datadict(
data, files, name)))
def render(self, name... | true | true |
f72753101e10bb8565a1a21aa5043b6b642088a5 | 2,482 | py | Python | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180601/get_virtual_network_gateway_learned_routes.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 37.044776 | 183 | 0.711523 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetVirtualNetworkGatewayLearnedRoutesResult',
'AwaitableGetVirtualNetworkGatewayLearnedRoutesResult',
'get_virtual_netwo... | true | true |
f727534c7c0bee61c6e00e981435b67795e4a56e | 9,381 | py | Python | 2016/maryland/scripts/maryland_election.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | null | null | null | 2016/maryland/scripts/maryland_election.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | 2 | 2016-08-12T20:52:24.000Z | 2021-02-08T20:24:27.000Z | 2016/maryland/scripts/maryland_election.py | democracyworks/hand-collection-to-vip | 0b6e90f6055c1325930b53905bba2d1bfc111457 | [
"BSD-3-Clause"
] | 1 | 2018-08-17T21:16:30.000Z | 2018-08-17T21:16:30.000Z | """
id,
date,
name,
election_type,
state_id,
is_statewide,
registration_info,
absentee_ballot_info,
results_uri,
polling_hours,
has_election_day_registration,
registration_deadline,
absentee_request_deadline,
hours_open_id
"""
import datetime
import csv
import config
from maryland_polling_location import PollingLoc... | 34.744444 | 151 | 0.58917 | """
id,
date,
name,
election_type,
state_id,
is_statewide,
registration_info,
absentee_ballot_info,
results_uri,
polling_hours,
has_election_day_registration,
registration_deadline,
absentee_request_deadline,
hours_open_id
"""
import datetime
import csv
import config
from maryland_polling_location import PollingLoc... | false | true |
f727542bee6fa712929c024c3afa8e0aad944e62 | 1,255 | py | Python | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 5 | 2018-11-07T15:37:41.000Z | 2020-05-27T10:29:02.000Z | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 39 | 2018-11-07T21:06:42.000Z | 2019-09-30T21:33:31.000Z | imaging_db/database/dataset.py | czbiohub/imagingDB | 1b1a58df3dbc94a43fb842cad198fb6c1c833326 | [
"MIT"
] | 2 | 2019-11-04T22:25:04.000Z | 2020-11-04T04:13:20.000Z | # coding=utf-8
from datetime import datetime
from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, DateTime
from imaging_db.database.base import Base
def _serial_to_date_time(dataset_serial):
substrs = dataset_serial.split("-")
date_time = datetime(int(substrs[1]), # year
... | 32.179487 | 83 | 0.620717 |
from datetime import datetime
from sqlalchemy import Column, String, Integer, Boolean, ForeignKey, DateTime
from imaging_db.database.base import Base
def _serial_to_date_time(dataset_serial):
substrs = dataset_serial.split("-")
date_time = datetime(int(substrs[1]),
int(substrs[2]... | true | true |
f7275494b8cb9e77d969fcf6476d10ca21e0e71f | 3,818 | py | Python | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-06T13:57:28.000Z | 2019-09-06T13:57:28.000Z | salt/sdb/confidant.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 2 | 2017-01-05T16:14:59.000Z | 2019-01-31T23:15:25.000Z | # -*- coding: utf-8 -*-
'''
An SDB module for getting credentials from confidant.
Configuring the Confidant module
================================
The module can be configured via sdb in the minion config:
.. code-block:: yaml
confidant:
driver: confidant
# The URL of the confidant web service
url: '... | 29.828125 | 79 | 0.678104 |
from __future__ import absolute_import
import logging
import copy
try:
import confidant.client
import confidant.formatter
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
log = logging.getLogger(__name__)
__virtualname__ = 'confidant'
def __virtual__():
if HAS_LIBS:
return __vi... | true | true |
f72755a1c07aa293fbde7de86964d0198d4ff90b | 2,102 | py | Python | hair_seg/evaluate.py | eric91sanchez/hair_seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | 4 | 2021-03-04T05:57:45.000Z | 2022-02-15T17:40:57.000Z | hair_seg/evaluate.py | vadik6666/hair-seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | 4 | 2021-06-08T22:43:59.000Z | 2022-03-12T00:51:40.000Z | hair_seg/evaluate.py | vadik6666/hair_seg | 4f688daac0ec4ea906ff0462ae51634293e35447 | [
"MIT"
] | null | null | null | """
Evaluate
"""
import re
import math
import datetime
import random
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from loss import iou_loss, HairMattingLoss, acc_loss, F1_loss
from utils import create_multi_figure
USE_CUDA = torch.cuda.is_a... | 26.948718 | 73 | 0.62274 |
import re
import math
import datetime
import random
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from loss import iou_loss, HairMattingLoss, acc_loss, F1_loss
from utils import create_multi_figure
USE_CUDA = torch.cuda.is_available()
DEVICE... | true | true |
f72755d6fecdb1531c133393712bc30acc965025 | 5,519 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_network_interface_load_balancers_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.412281 | 196 | 0.673854 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineRespo... | true | true |
f727572624c9b1104e87598335f97c84bacafded | 842 | py | Python | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | 1 | 2021-06-29T09:47:25.000Z | 2021-06-29T09:47:25.000Z | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | null | null | null | src/testing/migrations/0006_auto_20210617_1656.py | DiceNameIsMy/testing_sitev2 | c973f796bd1bd7cfcfc53298a3884b92d2a36d27 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-17 10:56
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testing', '0005_useranswer_is_correct'),
]
operations = [
migrations.AddField(
model_name='usertestresult',
... | 28.066667 | 99 | 0.599762 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testing', '0005_useranswer_is_correct'),
]
operations = [
migrations.AddField(
model_name='usertestresult',
name='end_time',
field=mode... | true | true |
f72757698a249ebc1ea831e90b3b83ef1660ea9a | 3,589 | py | Python | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/recommender/v1beta1/recommender-v1beta1-py/noxfile.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 26.984962 | 96 | 0.627751 |
import os
import pathlib
import shutil
import subprocess
import sys
import nox
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt"
PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="u... | true | true |
f727578d6163bc38fe54684ae5660bc222bf771a | 9,991 | py | Python | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | improver_tests/between_thresholds/test_between_thresholds.py | pnijhara/improver | 5961a6fab9a79cd63a943eff07bf79d4e5f0ff03 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 44.404444 | 88 | 0.624362 |
import unittest
import iris
import numpy as np
from iris.tests import IrisTest
from improver.between_thresholds import OccurrenceBetweenThresholds
from ..set_up_test_cubes import set_up_percentile_cube, set_up_probability_cube
class Test_process(IrisTest):
def setUp(self):
... | true | true |
f72759c1213da47f3d4defce97fc37be89c0f650 | 142 | py | Python | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | service_app/service_app/doctype/service/test_service.py | NahomAraya/Erpnext-App | 4648aa95b1b6ebf4ef9f80c2c02dbeb22277531d | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Appman and Contributors
# See license.txt
# import frappe
import unittest
class TestService(unittest.TestCase):
pass
| 15.777778 | 45 | 0.774648 |
import unittest
class TestService(unittest.TestCase):
pass
| true | true |
f72759c8061e47306fba82f635b426668b33c208 | 2,918 | py | Python | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | 1 | 2022-03-24T03:35:10.000Z | 2022-03-24T03:35:10.000Z | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | null | null | null | modules/swar/doc/splatted_prod.py | brycelelbach/nt2 | 73d7e8dd390fa4c8d251c6451acdae65def70e0b | [
"BSL-1.0"
] | null | null | null | [ ## this file was manually modified by jt
{
'functor' : {
'arity' : '1',
'call_types' : [],
'ret_arity' : '0',
'rturn' : {
'default' : 'T',
},
'special' : ['swar'],
'simd_types' : ['real_'],
'type_defs' : [],
't... | 38.906667 | 90 | 0.331391 | [ ty' : '1',
'call_types' : [],
'ret_arity' : '0',
'rturn' : {
'default' : 'T',
},
'special' : ['swar'],
'simd_types' : ['real_'],
'type_defs' : [],
'types' : ['real_'],
},
'info' : 'manually modified',
'unit' : ... | true | true |
f7275a40150b0c0246d5e22711d983f8a33d9abc | 1,585 | py | Python | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | 7 | 2021-10-06T17:02:13.000Z | 2022-03-22T10:45:23.000Z | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | 2 | 2022-03-16T11:20:54.000Z | 2022-03-24T13:54:49.000Z | tests/service/watcher/test_util.py | vinifmor/guapow | 59a9a1e6706bacbcb3d4bbc762ff9264d5e6f582 | [
"Zlib"
] | null | null | null | from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, AsyncMock, call
from guapow import __app_name__
from guapow.service.watcher import util
class MapProcessesTest(IsolatedAsyncioTestCase):
@patch(f'{__app_name__}.service.watcher.util.async_syscall', side_effect=[(0, " 1 # a \n 2 # b \n... | 49.53125 | 141 | 0.683912 | from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, AsyncMock, call
from guapow import __app_name__
from guapow.service.watcher import util
class MapProcessesTest(IsolatedAsyncioTestCase):
@patch(f'{__app_name__}.service.watcher.util.async_syscall', side_effect=[(0, " 1 # a \n 2 # b \n... | true | true |
f7275ca4a9614ae34d5dae69713b06a583c3d368 | 179 | py | Python | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | posts/forms.py | Kelit/My_blog | 891f082ac6b7a02ffbc8d106168cb0fd017ba3ef | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField
class PostForm(FlaskForm):
title = StringField('Заголовок')
body = TextAreaField('Текст')
| 22.375 | 46 | 0.77095 | from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField
class PostForm(FlaskForm):
title = StringField('Заголовок')
body = TextAreaField('Текст')
| true | true |
f7275ccef7ac1443c9619306e2735d5ade2696fa | 64 | py | Python | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | ptfims/__init__.py | rbiswas4/ptfdata | f50efd077bbf091e5108a6c95b0e24e4768ca4e6 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .ptfimages import *
| 21.333333 | 38 | 0.84375 | from __future__ import absolute_import
from .ptfimages import *
| true | true |
f7275d33269d0a2ea63c7f66122d5786bb653174 | 870 | py | Python | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | macWall.py | mathematics128/WinDD_Packaged_Wall | ec136adcf75e3f9c456149b995e2c0744bfe3c61 | [
"MIT"
] | null | null | null | from os import system, listdir
from PIL import Image
num = int(input('请输入你想生成的缩略图的长: ') )
for pic in listdir('.'):
if pic[-4:] == '.jpg':
tmp_pic = pic[:-4] + '.png'
temp_pic = pic[:-4] + '.bmp'
system('ffmpeg -i ' + pic + ' -vf scale=' + str(num) + ':-1 ' + tmp_pic)
system... | 33.461538 | 108 | 0.514943 | from os import system, listdir
from PIL import Image
num = int(input('请输入你想生成的缩略图的长: ') )
for pic in listdir('.'):
if pic[-4:] == '.jpg':
tmp_pic = pic[:-4] + '.png'
temp_pic = pic[:-4] + '.bmp'
system('ffmpeg -i ' + pic + ' -vf scale=' + str(num) + ':-1 ' + tmp_pic)
system... | true | true |
f7275daebdad04b10427a7fe30165f0dd0fc3904 | 533 | py | Python | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 46 | 2021-05-30T14:35:48.000Z | 2022-02-25T09:58:12.000Z | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 4 | 2021-08-10T14:11:52.000Z | 2021-12-30T17:59:28.000Z | root/messages.py | FilmyFather/TG-RenameBot | ae5e21c0da7c869c989a4ab7e1c79305f2ad3b61 | [
"MIT"
] | 102 | 2021-05-30T14:11:33.000Z | 2022-03-30T06:36:31.000Z | class Translation(object):
START_TEXT = "**I'm a Rename and Convert Bot\nJust send me any media to change file name.\nUse /help command for more details **"
######################
HELP_USER = """**>>Send File/Video\n>>Select desired Option\n>>And Done wait for it to process files**"""
DOWNLOAD_MSG = "**... | 53.3 | 134 | 0.634146 | class Translation(object):
START_TEXT = "**I'm a Rename and Convert Bot\nJust send me any media to change file name.\nUse /help command for more details **"
######################
HELP_USER = """**>>Send File/Video\n>>Select desired Option\n>>And Done wait for it to process files**"""
DOWNLOAD_MSG = "**... | true | true |
f7275dd92e798d7446dcdaf64a7b23e1afc7ec27 | 86,823 | py | Python | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 22 | 2017-07-18T09:39:34.000Z | 2021-09-16T09:41:03.000Z | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 9 | 2016-09-04T13:33:15.000Z | 2018-01-05T22:39:03.000Z | phriky_units/test_cps_units_checker.py | unl-nimbus-lab/phriky-units | 16c8cdd91de0899411b139e5a94fcb4ea8104ad2 | [
"MIT"
] | 4 | 2016-12-07T16:34:57.000Z | 2019-04-03T06:51:55.000Z | #!/usr/local/bin/python
import sys
# sys.path.append('/Users/jore/courses/NIMBUS/RESEARCH/CPS_TYPES/cps_units/')
import unittest
from detect_physical_unit_inconsistencies import CPSUnitsChecker
from unit_error_types import UnitErrorTypes
from unit_error import UnitError
import os
global_debug = False
global_debug_verb... | 52.588128 | 212 | 0.685176 |
import sys
import unittest
from detect_physical_unit_inconsistencies import CPSUnitsChecker
from unit_error_types import UnitErrorTypes
from unit_error import UnitError
import os
global_debug = False
global_debug_verbose = False
global_debug_AST = False
class TestStringMethods(unittest.TestCase):
def ... | true | true |
f7275de79abc81f51af3a3242318153f50472d2c | 1,465 | py | Python | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 21 | 2020-05-13T21:08:44.000Z | 2022-02-18T01:32:16.000Z | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 8 | 2020-11-23T09:28:04.000Z | 2022-02-02T12:04:08.000Z | app/rooms/examples/eg003_export_data_from_room/controller.py | olegliubimov/code-examples-python | 7af8c58138a9dd0f3b0be12eff1768ae23e449d3 | [
"MIT"
] | 26 | 2020-05-12T22:20:01.000Z | 2022-03-09T10:57:27.000Z | from docusign_rooms import RoomsApi
from flask import session, request
from ...utils import create_rooms_api_client
class Eg003Controller:
@staticmethod
def get_args():
"""Get required session and request arguments"""
return {
"account_id": session["ds_account_id"], # Represents ... | 31.170213 | 89 | 0.627304 | from docusign_rooms import RoomsApi
from flask import session, request
from ...utils import create_rooms_api_client
class Eg003Controller:
@staticmethod
def get_args():
return {
"account_id": session["ds_account_id"],
"access_token": session["ds_access_token"],
... | true | true |
f7275f87f8a46c54c59aa154abe1e2df4f3c1c6d | 18,246 | py | Python | tests/core/test_datamodules.py | lsqshr/pytorch-lightning | c6b68883879e38719688865aceac746477f0a9b9 | [
"Apache-2.0"
] | null | null | null | tests/core/test_datamodules.py | lsqshr/pytorch-lightning | c6b68883879e38719688865aceac746477f0a9b9 | [
"Apache-2.0"
] | null | null | null | tests/core/test_datamodules.py | lsqshr/pytorch-lightning | c6b68883879e38719688865aceac746477f0a9b9 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 33.478899 | 120 | 0.71961 |
import pickle
from argparse import ArgumentParser
from typing import Any, Dict
from unittest import mock
from unittest.mock import call, PropertyMock
import pytest
import torch
from pytorch_lightning import LightningDataModule, Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_... | true | true |
f7275fe5fae95e29aeb9f0a69b69a28a48dc9e9a | 2,048 | py | Python | jupyter_resource_usage/tests/test_basic.py | fcollonval/jupyter-resource-usage | 77ef2341efdee67a1457b6c6a0de5e001ca4c3aa | [
"BSD-2-Clause"
] | 1 | 2021-03-20T09:24:46.000Z | 2021-03-20T09:24:46.000Z | jupyter_resource_usage/tests/test_basic.py | fcollonval/jupyter-resource-usage | 77ef2341efdee67a1457b6c6a0de5e001ca4c3aa | [
"BSD-2-Clause"
] | null | null | null | jupyter_resource_usage/tests/test_basic.py | fcollonval/jupyter-resource-usage | 77ef2341efdee67a1457b6c6a0de5e001ca4c3aa | [
"BSD-2-Clause"
] | null | null | null | from mock import MagicMock
from mock import patch
class TestBasic:
"""Some basic tests, checking import, making sure APIs remain consistent, etc"""
def test_import_serverextension(self):
"""Check that serverextension hooks are available"""
from jupyter_resource_usage import (
_jup... | 35.929825 | 87 | 0.625488 | from mock import MagicMock
from mock import patch
class TestBasic:
def test_import_serverextension(self):
from jupyter_resource_usage import (
_jupyter_server_extension_paths,
_jupyter_nbextension_paths,
load_jupyter_server_extension,
)
assert _jupyter... | true | true |
f7275ff361eebaef39028e0b71a649811bfb8cc5 | 1,646 | py | Python | multitrackpy/mtt.py | bbo-lab/multitrackpy | a25ebdb94969b0682c851ab69ba5895173b581d0 | [
"BSD-3-Clause"
] | null | null | null | multitrackpy/mtt.py | bbo-lab/multitrackpy | a25ebdb94969b0682c851ab69ba5895173b581d0 | [
"BSD-3-Clause"
] | null | null | null | multitrackpy/mtt.py | bbo-lab/multitrackpy | a25ebdb94969b0682c851ab69ba5895173b581d0 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import h5py
from pprint import pprint
def read_calib(mtt_path):
mtt_file = h5py.File(mtt_path)
istracking = np.squeeze(np.asarray([mtt_file['mt']['cam_istracking']]) == 1)
calind = np.squeeze(np.int32(mtt_file['mt']['calind']))[istracking] - 1
mc = {
'Rglobal': np.asarray(m... | 36.577778 | 119 | 0.600243 | import numpy as np
import h5py
from pprint import pprint
def read_calib(mtt_path):
mtt_file = h5py.File(mtt_path)
istracking = np.squeeze(np.asarray([mtt_file['mt']['cam_istracking']]) == 1)
calind = np.squeeze(np.int32(mtt_file['mt']['calind']))[istracking] - 1
mc = {
'Rglobal': np.asarray(m... | true | true |
f727605ce453fa3224aa6df44afa7128f0668b0c | 2,544 | py | Python | tao_action_recognition/data_generation/split_dataset.py | morrimeg/tao_toolkit_recipes | 011f5426e2cec44af5b686d0c6225836460202f8 | [
"MIT"
] | null | null | null | tao_action_recognition/data_generation/split_dataset.py | morrimeg/tao_toolkit_recipes | 011f5426e2cec44af5b686d0c6225836460202f8 | [
"MIT"
] | null | null | null | tao_action_recognition/data_generation/split_dataset.py | morrimeg/tao_toolkit_recipes | 011f5426e2cec44af5b686d0c6225836460202f8 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved.
# 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, mod... | 39.75 | 81 | 0.72445 |
import os
import shutil
import sys
root_path = sys.argv[1]
split_files_path = sys.argv[2]
target_train_path = sys.argv[3]
target_test_path = sys.argv[4]
if not os.path.exists(target_train_path):
os.makedirs(target_train_path)
if not os.path.exists(target_test_path):
os.makedirs(target_test... | true | true |
f72760a70f1f2dd346effdba76e317afc3c4c200 | 458 | py | Python | Tests/misc/eexec_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 2,705 | 2016-09-27T10:02:12.000Z | 2022-03-31T09:37:46.000Z | Tests/misc/eexec_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 1,599 | 2016-09-27T09:07:36.000Z | 2022-03-31T23:04:51.000Z | Tests/misc/eexec_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 352 | 2016-10-07T04:18:15.000Z | 2022-03-30T07:35:01.000Z | from fontTools.misc.eexec import decrypt, encrypt
def test_decrypt():
testStr = b"\0\0asdadads asds\265"
decryptedStr, R = decrypt(testStr, 12321)
assert decryptedStr == b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1'
assert R == 36142
def test_encrypt():
testStr = b'0d\nh\x15\xe8\xc4\xb2\x15\x1... | 28.625 | 74 | 0.68559 | from fontTools.misc.eexec import decrypt, encrypt
def test_decrypt():
testStr = b"\0\0asdadads asds\265"
decryptedStr, R = decrypt(testStr, 12321)
assert decryptedStr == b'0d\nh\x15\xe8\xc4\xb2\x15\x1d\x108\x1a<6\xa1'
assert R == 36142
def test_encrypt():
testStr = b'0d\nh\x15\xe8\xc4\xb2\x15\x1... | true | true |
f7276149bae5156f7cb9fe99fd0ec9a0e37e83ee | 2,019 | py | Python | jigsaw/migrations/0004_auto_20160315_2014.py | sxyu/Jiggly | af705453902b11d7bc1f298dce4698fdc9a470fe | [
"FSFAP"
] | 3 | 2018-03-29T13:31:31.000Z | 2022-02-26T04:49:40.000Z | jigsaw/migrations/0004_auto_20160315_2014.py | sxyu/Jiggly | af705453902b11d7bc1f298dce4698fdc9a470fe | [
"FSFAP"
] | null | null | null | jigsaw/migrations/0004_auto_20160315_2014.py | sxyu/Jiggly | af705453902b11d7bc1f298dce4698fdc9a470fe | [
"FSFAP"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-16 03:14
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import jigsaw.models
class Migration(migrations.Migration):
dependencies = [
('jigsaw', '0003_auto_20160315_1733'),
... | 36.709091 | 142 | 0.592372 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import jigsaw.models
class Migration(migrations.Migration):
dependencies = [
('jigsaw', '0003_auto_20160315_1733'),
]
operations = [
migrations.CreateModel(
na... | true | true |
f727619381755861c088ab5d8fb34a9eb7540f17 | 341 | py | Python | LC/27.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/27.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/27.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def removeElement(self, nums, val):
"""
:type nums: List[int]
:type val: int
:rtype: int
"""
a=0
x=0
while(x<len(nums)):
if nums[x]==val:
nums.pop(x)
x-=1
x+=1
... | 21.3125 | 39 | 0.384164 | class Solution(object):
def removeElement(self, nums, val):
a=0
x=0
while(x<len(nums)):
if nums[x]==val:
nums.pop(x)
x-=1
x+=1
return len(nums) | true | true |
f727626a0369587c267d59e56782c18664512665 | 11,871 | py | Python | django/contrib/admin/util.py | t11e/django | 447f5375d378dba3bac1ded0306fa0d1b8ab55a4 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T13:32:33.000Z | 2016-05-08T13:32:33.000Z | django/contrib/admin/util.py | t11e/django | 447f5375d378dba3bac1ded0306fa0d1b8ab55a4 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/admin/util.py | t11e/django | 447f5375d378dba3bac1ded0306fa0d1b8ab55a4 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import formats
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.encoding import force_unicode, smart_unicode, smart_str
from dja... | 35.435821 | 94 | 0.598602 | from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import formats
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.encoding import force_unicode, smart_unicode, smart_str
from dja... | true | true |
f72762d80e22c0940fd6c0b7df91a5eb5427ea3d | 18,819 | py | Python | log_complete/model_403.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_403.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_403.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.354369 | 710 | 0.806525 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f72765a52a463ef2846870cae24daa680f1ff6c0 | 11,200 | py | Python | toontown/catalog/CatalogAccessoryItemGlobals.py | CrankySupertoon01/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | toontown/catalog/CatalogAccessoryItemGlobals.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | toontown/catalog/CatalogAccessoryItemGlobals.py | CrankySupertoonArchive/Toontown-2 | 60893d104528a8e7eb4aced5d0015f22e203466d | [
"MIT"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | ATArticle = 0
ATString = 1
ATBasePrice = 2
ATReleased = 3
ATEmblemPrices = 4
AHat = 0
AGlasses = 1
ABackpack = 2
AShoes = 3
APriceBasic = 250
APriceBasicPlus = 400
APriceCool = 800
APriceAwesome = 1500
AccessoryTypes = {101: (AHat,
'hbb1',
APriceBasic,
1),
102: (AHat,
'hsf1',
APriceC... | 15.176152 | 29 | 0.413304 | ATArticle = 0
ATString = 1
ATBasePrice = 2
ATReleased = 3
ATEmblemPrices = 4
AHat = 0
AGlasses = 1
ABackpack = 2
AShoes = 3
APriceBasic = 250
APriceBasicPlus = 400
APriceCool = 800
APriceAwesome = 1500
AccessoryTypes = {101: (AHat,
'hbb1',
APriceBasic,
1),
102: (AHat,
'hsf1',
APriceC... | true | true |
f727679b242e26a0cafd9fa4682d96dd99b90d0a | 2,309 | py | Python | Extra_python/Scripts/manualDel.py | JPGarCar/HORS | e06d4be00921d09f89406da5e64bbb5717c8bf07 | [
"MIT"
] | 1 | 2019-12-23T22:43:46.000Z | 2019-12-23T22:43:46.000Z | Extra_python/Scripts/manualDel.py | JPGarCar/HORS | e06d4be00921d09f89406da5e64bbb5717c8bf07 | [
"MIT"
] | 18 | 2021-01-15T02:35:48.000Z | 2021-12-08T17:39:51.000Z | Extra_python/Scripts/manualDel.py | JPGarCar/HORS | e06d4be00921d09f89406da5e64bbb5717c8bf07 | [
"MIT"
] | null | null | null | from cs50 import SQL
db = SQL("sqlite:///immuns.db")
global currentUser
def manualDel(number, curUser):
stem = db.execute("SELECT * FROM :dataBase WHERE id=:ids", dataBase=curUser, ids=number)
for stoop in stem:
comm = stoop["committee"]
db.execute("UPDATE generalList SET delegate_name = '' ... | 69.969697 | 149 | 0.672152 | from cs50 import SQL
db = SQL("sqlite:///immuns.db")
global currentUser
def manualDel(number, curUser):
stem = db.execute("SELECT * FROM :dataBase WHERE id=:ids", dataBase=curUser, ids=number)
for stoop in stem:
comm = stoop["committee"]
db.execute("UPDATE generalList SET delegate_name = '' ... | true | true |
f72767e3fe7d8c9e8e9895a0ec1f3c6a2f6fe9d2 | 1,765 | py | Python | products/migrations/0001_initial.py | UB-ES-2021-A1/wannasell-backend | 84360b2985fc28971867601373697f39303e396b | [
"Unlicense"
] | null | null | null | products/migrations/0001_initial.py | UB-ES-2021-A1/wannasell-backend | 84360b2985fc28971867601373697f39303e396b | [
"Unlicense"
] | 62 | 2021-11-22T21:52:44.000Z | 2021-12-17T15:07:02.000Z | products/migrations/0001_initial.py | UB-ES-2021-A1/wannasell-backend | 84360b2985fc28971867601373697f39303e396b | [
"Unlicense"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-18 11:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
... | 51.911765 | 615 | 0.586969 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(auto_create... | true | true |
f727686cecf1ae4d8cd0131fdaf4bd65fedf922c | 8,921 | py | Python | python_samples/Python_Examples/ibm_db/ibm_db-special_columns.py | adrianmahjour/db2-samples | ff984aec81c5c08ce28443d896c0818cfae4f789 | [
"Apache-2.0"
] | 54 | 2019-08-02T13:15:07.000Z | 2022-03-21T17:36:48.000Z | python_samples/Python_Examples/ibm_db/ibm_db-special_columns.py | junsulee75/db2-samples | d9ee03101cad1f9167eebc1609b4151559124017 | [
"Apache-2.0"
] | 13 | 2019-07-26T13:51:16.000Z | 2022-03-25T21:43:52.000Z | python_samples/Python_Examples/ibm_db/ibm_db-special_columns.py | junsulee75/db2-samples | d9ee03101cad1f9167eebc1609b4151559124017 | [
"Apache-2.0"
] | 75 | 2019-07-20T04:53:24.000Z | 2022-03-23T20:56:55.000Z | #! /usr/bin/python3
#-------------------------------------------------------------------------------------------------#
# NAME: ibm_db-special_columns.py #
# #
... | 56.462025 | 99 | 0.512723 |
import sys
import ibm_db
from ibm_db_tools import Db2ConnectionMgr
from ipynb_exit import exit
dbName = "SAMPLE"
userID = "db2inst1"
passWord = "Passw0rd"
dbConnection = None
schemaName = userID.upper()
tableName = "EMPLOYEE"
resultSet = False
dataRecord = False
sqlDataTypes = {0 : "SQL_UNKNOWN_TY... | true | true |
f72768f88bd6b9a784e985befa28896108619edb | 3,690 | py | Python | tests/integration/test_unsteady_ring_vortex_lattice_method_static_geometry.py | KamiGazi/PteraSoftware | 3b6f6bfb8db776970674234cb524c338ecc82df1 | [
"MIT"
] | null | null | null | tests/integration/test_unsteady_ring_vortex_lattice_method_static_geometry.py | KamiGazi/PteraSoftware | 3b6f6bfb8db776970674234cb524c338ecc82df1 | [
"MIT"
] | null | null | null | tests/integration/test_unsteady_ring_vortex_lattice_method_static_geometry.py | KamiGazi/PteraSoftware | 3b6f6bfb8db776970674234cb524c338ecc82df1 | [
"MIT"
] | null | null | null | """This is a testing case for the unsteady ring vortex lattice method solver with
static geometry.
Based on an equivalent XFLR5 testing case, the expected output for this case is:
CL: 0.588
CDi: 0.011
Cm: -0.197
Note: The expected output was created using XFLR5's inviscid VLM2 analysis type,
wh... | 32.946429 | 109 | 0.712737 | import unittest
import pterasoftware as ps
from tests.integration.fixtures import solver_fixtures
class TestUnsteadyRingVortexLatticeMethodStaticGeometry(unittest.TestCase):
def setUp(self):
self.unsteady_ring_vortex_lattice_method_validation_solver = (
solver_fixtures.make_unstead... | true | true |
f7276a118dd544956c6a75767571b4963130bb32 | 192 | py | Python | setup.py | ericlee0803/lookahead_release | 373295f11be81d82b1c69eeadeec32ae96f26b1f | [
"MIT"
] | 3 | 2020-06-17T20:25:12.000Z | 2020-11-24T17:21:59.000Z | setup.py | ericlee0803/lookahead_release | 373295f11be81d82b1c69eeadeec32ae96f26b1f | [
"MIT"
] | null | null | null | setup.py | ericlee0803/lookahead_release | 373295f11be81d82b1c69eeadeec32ae96f26b1f | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='lookahead',
version='0.0.2',
packages=find_packages(),
install_requires=['scikit-learn', 'scipy', 'numpy', 'qmcpy']
)
| 21.333333 | 64 | 0.671875 | from setuptools import setup, find_packages
setup(
name='lookahead',
version='0.0.2',
packages=find_packages(),
install_requires=['scikit-learn', 'scipy', 'numpy', 'qmcpy']
)
| true | true |
f7276a2c611535e6562f2d0b10dcd978082fd085 | 10,047 | py | Python | gabriel/server/gabriel3/proxy/common.py | lee4138/6d-pose-estimation-with-ml-in-ar | e29162c82c867d4a8177322d7d49a55c5fd90639 | [
"MIT"
] | 7 | 2020-02-04T10:58:58.000Z | 2021-11-26T07:37:22.000Z | gabriel/server/gabriel3/proxy/common.py | buaafw/6d-pose-estimation-with-ml-in-ar | e29162c82c867d4a8177322d7d49a55c5fd90639 | [
"MIT"
] | 1 | 2021-02-19T03:56:10.000Z | 2021-02-19T03:56:10.000Z | gabriel/server/gabriel3/proxy/common.py | buaafw/6d-pose-estimation-with-ml-in-ar | e29162c82c867d4a8177322d7d49a55c5fd90639 | [
"MIT"
] | 8 | 2019-12-05T10:05:36.000Z | 2021-01-27T14:09:53.000Z | #!/usr/bin/env python
#
# Cloudlet Infrastructure for Mobile Computing
#
# Author: Kiryong Ha <krha@cmu.edu>
# Zhuo Chen <zhuoc@cs.cmu.edu>
#
# Copyright (C) 2011-2013 Carnegie Mellon University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... | 36.270758 | 159 | 0.643973 |
import json
import multiprocessing
import queue
import select
import socket
import struct
import sys
import threading
import time
import traceback
import gabriel3
LOG = gabriel3.logging.getLogger(__name__)
class ProxyError(Exception):
pass
class SensorReceiveClient(gabriel3.network.Common... | true | true |
f7276a69899ad99ba6680fb0b931907cb13b39e3 | 2,402 | py | Python | src/wormhole/test/dilate/test_parse.py | dmgolembiowski/magic-wormhole | d517a10282d5e56f300db462b1a6eec517202af7 | [
"MIT"
] | 2,801 | 2021-01-10T16:37:14.000Z | 2022-03-31T19:02:50.000Z | src/wormhole/test/dilate/test_parse.py | dmgolembiowski/magic-wormhole | d517a10282d5e56f300db462b1a6eec517202af7 | [
"MIT"
] | 52 | 2021-01-10T01:54:00.000Z | 2022-03-11T13:12:41.000Z | src/wormhole/test/dilate/test_parse.py | dmgolembiowski/magic-wormhole | d517a10282d5e56f300db462b1a6eec517202af7 | [
"MIT"
] | 106 | 2021-01-21T14:32:22.000Z | 2022-03-18T10:33:09.000Z | from __future__ import print_function, unicode_literals
import mock
from twisted.trial import unittest
from ..._dilation.connection import (parse_record, encode_record,
KCM, Ping, Pong, Open, Data, Close, Ack)
class Parse(unittest.TestCase):
def test_parse(self):
self.... | 53.377778 | 85 | 0.594088 | from __future__ import print_function, unicode_literals
import mock
from twisted.trial import unittest
from ..._dilation.connection import (parse_record, encode_record,
KCM, Ping, Pong, Open, Data, Close, Ack)
class Parse(unittest.TestCase):
def test_parse(self):
self.... | true | true |
f7276c0f73e6ebdbc9164c77803a6a39d802249f | 4,350 | py | Python | tests/test_stream_xep_0047.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_stream_xep_0047.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_stream_xep_0047.py | marconfus/slixmpp | bcf186f42dc31d360e0a0af8a4b3aaf1e0b212aa | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import threading
import time
import unittest
from slixmpp.test import SlixTest
class TestInBandByteStreams(SlixTest):
def setUp(self):
self.stream_start(plugins=['xep_0047', 'xep_0030'])
def tearDown(self):
self.stream_close()
def testOpenStream(self):
"""Test re... | 27.018634 | 74 | 0.50092 | import asyncio
import threading
import time
import unittest
from slixmpp.test import SlixTest
class TestInBandByteStreams(SlixTest):
def setUp(self):
self.stream_start(plugins=['xep_0047', 'xep_0030'])
def tearDown(self):
self.stream_close()
def testOpenStream(self):
events = ... | true | true |
f7276ccb81e55d56903c23dd551e1c32e13eedf8 | 402 | py | Python | Lab-assignment/A-2/digitalRoot.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | 2 | 2020-09-01T04:58:16.000Z | 2021-01-30T03:45:52.000Z | Lab-assignment/A-2/digitalRoot.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | null | null | null | Lab-assignment/A-2/digitalRoot.py | HembramBeta777/Python-Programming | 827611b0613d9d953d13fb04ea9b5c5ac3c510f2 | [
"BSD-3-Clause"
] | null | null | null | # PROGRAM: To find the digital root of an integer
# FILE: digitalRoot.py
# CREATED BY: Santosh Hembram
# DATED: 23-09-20
num = int(input("Enter an integer: "))
temp = num
sum = 10
while(sum>=10):
sum = 0
while(num!=0):
dg = num % 10
sum = sum + dg
num = num // 1... | 15.461538 | 50 | 0.517413 |
num = int(input("Enter an integer: "))
temp = num
sum = 10
while(sum>=10):
sum = 0
while(num!=0):
dg = num % 10
sum = sum + dg
num = num // 10
num = sum
print("The digital root of ",temp,"is",sum)
| true | true |
f7276d8b2cac2a3f653f6513bcab4a0e6a780d71 | 1,583 | py | Python | airflow/migrations/versions/0101_a3bcd0914482_add_data_compressed_to_serialized_dag.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 8,092 | 2016-04-27T20:32:29.000Z | 2019-01-05T07:39:33.000Z | airflow/migrations/versions/0101_a3bcd0914482_add_data_compressed_to_serialized_dag.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 2,961 | 2016-05-05T07:16:16.000Z | 2019-01-05T08:47:59.000Z | airflow/migrations/versions/0101_a3bcd0914482_add_data_compressed_to_serialized_dag.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | 3,546 | 2016-05-04T20:33:16.000Z | 2019-01-05T05:14:26.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 32.979167 | 88 | 0.760581 |
import sqlalchemy as sa
from alembic import op
revision = 'a3bcd0914482'
down_revision = 'e655c0453f75'
branch_labels = None
depends_on = None
airflow_version = '2.3.0'
def upgrade():
with op.batch_alter_table('serialized_dag') as batch_op:
batch_op.alter_column('data', existing_type=... | true | true |
f7276e95cabbe199d785db08683a32a5ff10b6c4 | 3,062 | py | Python | code/options.py | frizman04/language-style-transfer-python3 | 9110eb9d5b72d2926f805ac258915c0f1a369638 | [
"Apache-2.0"
] | 3 | 2018-07-11T07:41:58.000Z | 2022-02-10T09:34:32.000Z | code/options.py | frizman04/language-style-transfer-python3 | 9110eb9d5b72d2926f805ac258915c0f1a369638 | [
"Apache-2.0"
] | null | null | null | code/options.py | frizman04/language-style-transfer-python3 | 9110eb9d5b72d2926f805ac258915c0f1a369638 | [
"Apache-2.0"
] | null | null | null | import sys
import argparse
import pprint
def load_arguments():
argparser = argparse.ArgumentParser(sys.argv[0])
argparser.add_argument('--train',
type=str,
default='')
argparser.add_argument('--dev',
type=str,
default='')
argparser.add_argum... | 29.728155 | 81 | 0.497061 | import sys
import argparse
import pprint
def load_arguments():
argparser = argparse.ArgumentParser(sys.argv[0])
argparser.add_argument('--train',
type=str,
default='')
argparser.add_argument('--dev',
type=str,
default='')
argparser.add_argum... | true | true |
f7276ecb99f6a3382aea6076e38bd2ab95a340d1 | 239 | py | Python | tests/configs/fragment_config_overrides.py | aptdamia/jirahub | f12516254784db23367f96ad7e6bb1b127d9de3f | [
"BSD-3-Clause"
] | 10 | 2018-06-18T19:46:21.000Z | 2022-03-03T20:50:15.000Z | tests/configs/fragment_config_overrides.py | aptdamia/jirahub | f12516254784db23367f96ad7e6bb1b127d9de3f | [
"BSD-3-Clause"
] | 19 | 2018-04-13T15:01:51.000Z | 2022-01-20T21:21:15.000Z | tests/configs/fragment_config_overrides.py | aptdamia/jirahub | f12516254784db23367f96ad7e6bb1b127d9de3f | [
"BSD-3-Clause"
] | 9 | 2018-04-04T19:14:21.000Z | 2021-02-25T07:52:12.000Z | # This config is incomplete, but will specify all the required key
# when combined with fragment_config_base.py.
c.jira.project_key = "TEST"
c.jira.max_retries = 7
c.jira.sync_milestones = False
c.github.repository = "testing/test-repo"
| 26.555556 | 66 | 0.774059 |
c.jira.project_key = "TEST"
c.jira.max_retries = 7
c.jira.sync_milestones = False
c.github.repository = "testing/test-repo"
| true | true |
f7276f21393a47035bbe973f09006fec1326f4ec | 4,735 | py | Python | members/amit/clf/data_generator_binary.py | Leofltt/rg_sound_generation | 8e79b4d9dce028def43284f80521a2ec61d0066c | [
"MIT"
] | null | null | null | members/amit/clf/data_generator_binary.py | Leofltt/rg_sound_generation | 8e79b4d9dce028def43284f80521a2ec61d0066c | [
"MIT"
] | null | null | null | members/amit/clf/data_generator_binary.py | Leofltt/rg_sound_generation | 8e79b4d9dce028def43284f80521a2ec61d0066c | [
"MIT"
] | null | null | null | import random
import shutil
import os
import numpy as np
import data_loader
import audio_processing
from typing import Dict
from loguru import logger
from tqdm import tqdm
from pprint import pprint
class DataGenerator:
def __init__(self, conf: Dict, batch_size: int = 8):
assert "csv_file_path" in conf
... | 39.132231 | 98 | 0.583316 | import random
import shutil
import os
import numpy as np
import data_loader
import audio_processing
from typing import Dict
from loguru import logger
from tqdm import tqdm
from pprint import pprint
class DataGenerator:
def __init__(self, conf: Dict, batch_size: int = 8):
assert "csv_file_path" in conf
... | true | true |
f727702ee7977a991a5617a1ff32f85463c61f40 | 4,108 | py | Python | feedback_system/findTable.py | bshrram/Graduation-Project---Omnidirectional-Conveyor-Table | 6414fbcb3d53f3c3351c25ac8b48aa73397c250d | [
"MIT"
] | 1 | 2020-09-24T05:06:17.000Z | 2020-09-24T05:06:17.000Z | feedback_system/findTable.py | bshrram/Graduation-Project---Omnidirectional-Conveyor-Table | 6414fbcb3d53f3c3351c25ac8b48aa73397c250d | [
"MIT"
] | null | null | null | feedback_system/findTable.py | bshrram/Graduation-Project---Omnidirectional-Conveyor-Table | 6414fbcb3d53f3c3351c25ac8b48aa73397c250d | [
"MIT"
] | 1 | 2020-12-13T13:31:08.000Z | 2020-12-13T13:31:08.000Z | import numpy as np
import cv2 as cv
flann_params= dict(algorithm = 6,
table_number = 6, # 12
key_size = 12, # 20
multi_probe_level = 1) #2
def init_feature():
"""initialize feature detector and matcher algorithm
"""
detector = cv.ORB_create(300... | 31.844961 | 110 | 0.565725 | import numpy as np
import cv2 as cv
flann_params= dict(algorithm = 6,
table_number = 6,
key_size = 12,
multi_probe_level = 1)
def init_feature():
detector = cv.ORB_create(3000)
norm = cv.NORM_HAMMING
matcher = cv.FlannBasedMatcher(flann... | true | true |
f72771a425e944529c8133e292bae69e1f9dc774 | 1,013 | py | Python | tensorlayer/package_info.py | Officium/tensorlayer | 89bd7646cff2bc77c6569f2a51d48bc1e80229e4 | [
"Apache-2.0"
] | 2 | 2020-10-18T15:43:49.000Z | 2020-10-27T14:52:48.000Z | tensorlayer/package_info.py | sheiiva/tensorlayer | 5d692fe87ac4d4439506b5c4827399fd5a8ab5da | [
"Apache-2.0"
] | null | null | null | tensorlayer/package_info.py | sheiiva/tensorlayer | 5d692fe87ac4d4439506b5c4827399fd5a8ab5da | [
"Apache-2.0"
] | 1 | 2020-10-15T13:15:40.000Z | 2020-10-15T13:15:40.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""Deep learning and Reinforcement learning library for Researchers and Engineers."""
MAJOR = 2
MINOR = 1
PATCH = 1
PRE_RELEASE = ''
# Use the following formatting: (major, minor, patch, prerelease)
VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE)
__shortversion__ = '.'.join(map... | 40.52 | 96 | 0.757157 |
MAJOR = 2
MINOR = 1
PATCH = 1
PRE_RELEASE = ''
VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE)
__shortversion__ = '.'.join(map(str, VERSION[:3]))
__version__ = '.'.join(map(str, VERSION[:3])) + ''.join(VERSION[3:])
__package_name__ = 'tensorlayer'
__contact_names__ = 'TensorLayer Contributors'
__contact_emails__ = '... | true | true |
f7277265e7244b7ff4545ccd5788d0ae944adadd | 167 | py | Python | setup.py | contolini/regulations-site | c31a9ce3097910877657f61b4c19a4ccbd0f967f | [
"CC0-1.0"
] | null | null | null | setup.py | contolini/regulations-site | c31a9ce3097910877657f61b4c19a4ccbd0f967f | [
"CC0-1.0"
] | null | null | null | setup.py | contolini/regulations-site | c31a9ce3097910877657f61b4c19a4ccbd0f967f | [
"CC0-1.0"
] | null | null | null | from setuptools import setup, find_packages
setup(
name = "regulations",
version = "0.1.0",
license = "public domain",
packages = find_packages()
)
| 18.555556 | 43 | 0.646707 | from setuptools import setup, find_packages
setup(
name = "regulations",
version = "0.1.0",
license = "public domain",
packages = find_packages()
)
| true | true |
f7277275036c1c4151a7b860aa018f1c5a139255 | 3,246 | py | Python | scripts/ServerPoolMachinesHealth.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | scripts/ServerPoolMachinesHealth.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | scripts/ServerPoolMachinesHealth.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | from com.jcraft.jsch import JSchException
from com.jcraft.jsch import JSch
from org.python.core.util import FileUtil
from java.time import Duration
from com.couchbase.client.java import Cluster, ClusterOptions
from com.couchbase.client.java.env import ClusterEnvironment
from com.couchbase.client.core.env import Timeout... | 37.744186 | 222 | 0.66451 | from com.jcraft.jsch import JSchException
from com.jcraft.jsch import JSch
from org.python.core.util import FileUtil
from java.time import Duration
from com.couchbase.client.java import Cluster, ClusterOptions
from com.couchbase.client.java.env import ClusterEnvironment
from com.couchbase.client.core.env import Timeout... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.