hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75ae7de2a31bd360f1b62e76940425b5a4f20a6 | 2,443 | py | Python | lib/spack/spack/test/container/docker.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-09-02T11:55:57.000Z | 2020-09-02T11:55:57.000Z | lib/spack/spack/test/container/docker.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2022-03-09T09:15:39.000Z | 2022-03-09T09:15:42.000Z | lib/spack/spack/test/container/docker.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-15T02:37:59.000Z | 2020-09-21T04:34:38.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.container.writers as writers
def test_manifest(minimal_configuration):
writer = writers.create(minimal_... | 32.573333 | 73 | 0.737208 |
import spack.container.writers as writers
def test_manifest(minimal_configuration):
writer = writers.create(minimal_configuration)
manifest_str = writer.manifest
for line in manifest_str.split('\n'):
assert 'echo' in line
def test_build_and_run_images(minimal_configuration):
writer = writer... | true | true |
f75ae80200a7f7839200e029667754a49721cb0b | 98 | py | Python | tests/test_auth.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | tests/test_auth.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | tests/test_auth.py | prashbnair/fabric8-analytics-server | af1f71018b82ebafae7701a443412eed34de5a15 | [
"Apache-2.0"
] | null | null | null | """Tests for classes and functions from the auth module."""
if __name__ == '__main__':
pass
| 16.333333 | 59 | 0.673469 |
if __name__ == '__main__':
pass
| true | true |
f75ae8687c20cac90d4113c3d753bfd84db4c3c9 | 230 | py | Python | src/cube/op/new/identity.py | jedhsu/cortex | d610570743d59272c7e6326d10c53d55950e87fc | [
"Apache-2.0"
] | null | null | null | src/cube/op/new/identity.py | jedhsu/cortex | d610570743d59272c7e6326d10c53d55950e87fc | [
"Apache-2.0"
] | null | null | null | src/cube/op/new/identity.py | jedhsu/cortex | d610570743d59272c7e6326d10c53d55950e87fc | [
"Apache-2.0"
] | null | null | null | """
*Identity*
"""
from dataclasses import dataclass
import jax.numpy as jnp
from ._operator import CreationalOperator
__all__ = ["Identity"]
@dataclass
class Identity(
CreationalOperator,
):
operator = jnp.eye
| 11.5 | 41 | 0.708696 | from dataclasses import dataclass
import jax.numpy as jnp
from ._operator import CreationalOperator
__all__ = ["Identity"]
@dataclass
class Identity(
CreationalOperator,
):
operator = jnp.eye
| true | true |
f75ae8ab3774f8426e519e483830a2c6ee30b0b8 | 110 | py | Python | radar_do_carro_main/apps.py | marcuusmelo/radar_do_carro_web | be7ec0896c357f5c05838c63259be3f46ce4dbf4 | [
"MIT"
] | null | null | null | radar_do_carro_main/apps.py | marcuusmelo/radar_do_carro_web | be7ec0896c357f5c05838c63259be3f46ce4dbf4 | [
"MIT"
] | null | null | null | radar_do_carro_main/apps.py | marcuusmelo/radar_do_carro_web | be7ec0896c357f5c05838c63259be3f46ce4dbf4 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class RadarDoCarroMainConfig(AppConfig):
name = 'radar_do_carro_main'
| 18.333333 | 40 | 0.8 | from django.apps import AppConfig
class RadarDoCarroMainConfig(AppConfig):
name = 'radar_do_carro_main'
| true | true |
f75ae8e9b6683d87bc99aa1780b81a3a1233da9f | 1,476 | py | Python | mindhome_alpha/erpnext/www/lms/topic.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | mindhome_alpha/erpnext/www/lms/topic.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | null | null | null | mindhome_alpha/erpnext/www/lms/topic.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
no_cache = 1
def get_context(context):
try:
course = frappe.form_dict['course']
program = frappe.form_dict['program']
topic = frappe.form_dict['topic']
except KeyError:
frappe.local.flags.redirect_location = '/lms'... | 32.8 | 129 | 0.737805 | from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
no_cache = 1
def get_context(context):
try:
course = frappe.form_dict['course']
program = frappe.form_dict['program']
topic = frappe.form_dict['topic']
except KeyError:
frappe.local.flags.redirect_location = '/lms'... | true | true |
f75ae8f8d8e758ae2ee35befbe4f985c8213ea5a | 631 | py | Python | Scintilla/test/XiteMenu.py | tobeypeters/Scintilla | 3f1ccba00b5817a5ba548288822a59b0a0f73d92 | [
"MIT"
] | 19 | 2019-01-15T12:11:31.000Z | 2021-11-29T22:24:14.000Z | Scintilla/test/XiteMenu.py | tobeypeters/Scintilla | 3f1ccba00b5817a5ba548288822a59b0a0f73d92 | [
"MIT"
] | 5 | 2018-09-13T15:40:00.000Z | 2021-05-16T15:13:53.000Z | Scintilla/test/XiteMenu.py | tobeypeters/Scintilla | 3f1ccba00b5817a5ba548288822a59b0a0f73d92 | [
"MIT"
] | 4 | 2018-12-04T08:06:41.000Z | 2022-03-26T19:39:56.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Define the menu structure used by the Pentacle applications """
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
... | 21.758621 | 68 | 0.448494 |
from __future__ import unicode_literals
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
["Exercised", ""],
["Uncalled", ""],
["-", ""],
["&Exit", ""]]],
[ "&Edit", [
["... | true | true |
f75ae8ff537a0ca9b91370b2556a344deb93b4f9 | 4,472 | py | Python | services/image-to-ascii-api/generate_ascii_post.py | MerkleBros/generate-ascii-art-from-photographs | 966f83737d32bd7cd8858e94ac0d2b1aef24e676 | [
"MIT"
] | null | null | null | services/image-to-ascii-api/generate_ascii_post.py | MerkleBros/generate-ascii-art-from-photographs | 966f83737d32bd7cd8858e94ac0d2b1aef24e676 | [
"MIT"
] | 8 | 2021-03-10T03:21:52.000Z | 2022-03-12T00:11:46.000Z | services/image-to-ascii-api/generate_ascii_post.py | MerkleBros/generate-ascii-art-from-photographs | 966f83737d32bd7cd8858e94ac0d2b1aef24e676 | [
"MIT"
] | null | null | null | import base64
import io
import os
import json
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from colour import Color
def generate_ascii_post(event, context):
try:
print("## ENVIRONMENT")
print(os.environ)
print("## EVENT")
print(event)
response = {
... | 31.492958 | 100 | 0.594141 | import base64
import io
import os
import json
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from colour import Color
def generate_ascii_post(event, context):
try:
print("## ENVIRONMENT")
print(os.environ)
print("## EVENT")
print(event)
response = {
... | true | true |
f75ae91a13abf036eb07f535f2646fe337612ebc | 3,417 | py | Python | vega/networks/pytorch/customs/modnas/arch_space/construct/torch/torch.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/networks/pytorch/customs/modnas/arch_space/construct/torch/torch.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/networks/pytorch/customs/modnas/arch_space/construct/torch/torch.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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... | 30.238938 | 74 | 0.661692 |
import torch
from modnas.registry.construct import register
from modnas.arch_space.slot import Slot
from modnas.arch_space import ops
from modnas.core.param_space import ParamSpace
from modnas.utils.logging import get_logger
from modnas import backend
logger = get_logger('construct')
def parse_device(device):
... | true | true |
f75ae9a731048819dec0bf625ddb19dfcc209c1a | 3,836 | py | Python | plugins/modules/ovirt_cluster_info.py | bverschueren/ovirt-ansible-collection | 88073ca50f599ffc7638a83fec9cb49935455a39 | [
"Apache-2.0"
] | null | null | null | plugins/modules/ovirt_cluster_info.py | bverschueren/ovirt-ansible-collection | 88073ca50f599ffc7638a83fec9cb49935455a39 | [
"Apache-2.0"
] | null | null | null | plugins/modules/ovirt_cluster_info.py | bverschueren/ovirt-ansible-collection | 88073ca50f599ffc7638a83fec9cb49935455a39 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | 33.356522 | 142 | 0.688738 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: ovirt_cluster_info
short_description: Retrieve information about one or more oVirt/RHV clusters
version_added: "1.0.0"
author:
- "Ondra Machacek (... | true | true |
f75ae9f523ba9d587338749c6a909ee2554c64d1 | 881 | py | Python | draughtcraft/controllers/error.py | ryanpetrello/draughtcraft | 8eba4f659f6623593cf7b015a94552281b11a840 | [
"BSD-3-Clause"
] | null | null | null | draughtcraft/controllers/error.py | ryanpetrello/draughtcraft | 8eba4f659f6623593cf7b015a94552281b11a840 | [
"BSD-3-Clause"
] | null | null | null | draughtcraft/controllers/error.py | ryanpetrello/draughtcraft | 8eba4f659f6623593cf7b015a94552281b11a840 | [
"BSD-3-Clause"
] | null | null | null | from pecan import expose
class ErrorController(object):
default_status = (
"An Error Occurred",
"""
Sorry, something seems to have gone wrong in handling your request.
"""
)
status = {
401: (
"Unauthorized",
"Sorry, you don't have permission... | 25.171429 | 75 | 0.518729 | from pecan import expose
class ErrorController(object):
default_status = (
"An Error Occurred",
"""
Sorry, something seems to have gone wrong in handling your request.
"""
)
status = {
401: (
"Unauthorized",
"Sorry, you don't have permission... | true | true |
f75aea4b56522cf47087bd5a599b218c24ccf790 | 3,400 | py | Python | lightbulb_bot/commands/userinfo.py | davfsa/hikari-intro | a00c74416140817de5a5b234c29e279b34592fdc | [
"BSD-3-Clause"
] | null | null | null | lightbulb_bot/commands/userinfo.py | davfsa/hikari-intro | a00c74416140817de5a5b234c29e279b34592fdc | [
"BSD-3-Clause"
] | null | null | null | lightbulb_bot/commands/userinfo.py | davfsa/hikari-intro | a00c74416140817de5a5b234c29e279b34592fdc | [
"BSD-3-Clause"
] | null | null | null | import datetime as dt
import random
import typing as t
import hikari
# import lightbulb # You may need lightbulb if you extend this.
from lightbulb import slash_commands
from .. import GUILD_ID
# Create a slash command class. The name is automatically set to the
# lower case version of the class name.
class Userin... | 38.202247 | 85 | 0.583529 | import datetime as dt
import random
import typing as t
import hikari
from lightbulb import slash_commands
from .. import GUILD_ID
class Userinfo(slash_commands.SlashCommand):
@property
def options(self) -> list[hikari.CommandOption]:
return [
# unless it's... | true | true |
f75aea5b0fcbf2335b52ac3ff84665cbaf09e389 | 1,111 | py | Python | setup.py | maquchizi/gql | 00e213d97da9a283ec9949262086756509c5da40 | [
"MIT"
] | null | null | null | setup.py | maquchizi/gql | 00e213d97da9a283ec9949262086756509c5da40 | [
"MIT"
] | null | null | null | setup.py | maquchizi/gql | 00e213d97da9a283ec9949262086756509c5da40 | [
"MIT"
] | null | null | null | import sys
from setuptools import setup, find_packages
setup(
name='gql',
version='0.1.1',
description='GraphQL client for Python',
long_description=open('README.rst').read(),
url='https://github.com/graphql-python/gql',
author='Syrus Akbary',
author_email='me@syrusakbary.com',
license=... | 32.676471 | 67 | 0.60036 | import sys
from setuptools import setup, find_packages
setup(
name='gql',
version='0.1.1',
description='GraphQL client for Python',
long_description=open('README.rst').read(),
url='https://github.com/graphql-python/gql',
author='Syrus Akbary',
author_email='me@syrusakbary.com',
license=... | true | true |
f75aeb13d27a6885d574e29c58a7d2682b2b818e | 3,882 | py | Python | modules/wordlist_gen.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 250 | 2016-12-29T02:43:04.000Z | 2022-03-31T05:51:23.000Z | modules/wordlist_gen.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 2 | 2017-08-08T06:22:10.000Z | 2021-05-22T01:59:43.000Z | modules/wordlist_gen.py | Lola224/hakkuframework | b9b87457a24df34f00ceece4928679c6d6b52f59 | [
"MIT"
] | 86 | 2016-12-29T06:39:34.000Z | 2021-12-12T20:07:39.000Z | # Copyright (C) 2015 – 2021 Noa-Emil Nissinen (4shadoww)
from core.hakkuframework import *
from core import colors
import threading, queue
import itertools
from os.path import relpath
from core import getpath
conf = {
"name": "wordlist_gen", # Module's name (should be same as file name)
"version": "1.0", # Mo... | 26.589041 | 124 | 0.580371 |
from core.hakkuframework import *
from core import colors
import threading, queue
import itertools
from os.path import relpath
from core import getpath
conf = {
"name": "wordlist_gen", "version": "1.0", # Module version
"shortdesc": "word list generator", # Short description
"github": "4shadoww", # Au... | true | true |
f75aeb4219c881b42447d5ef5a98bdea6112c406 | 9,334 | py | Python | vtam/utils/RunnerWopmars.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 1 | 2020-11-26T11:25:02.000Z | 2020-11-26T11:25:02.000Z | vtam/utils/RunnerWopmars.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 25 | 2020-11-13T13:45:45.000Z | 2022-03-09T08:38:56.000Z | vtam/utils/RunnerWopmars.py | RaphaelHebert/vtam | 6cbc7e241f9aa4245f5fd000769b9765333d41c2 | [
"MIT"
] | 4 | 2021-03-25T18:18:52.000Z | 2022-01-08T10:37:39.000Z | import jinja2
import os
import pathlib
import tempfile
from vtam.utils.FileParams import FileParams
from vtam.utils.PathManager import PathManager
from vtam.utils.Singleton import Singleton
class RunnerWopmars(Singleton):
def __init__(self, command, cli_args_dic):
"""
:param command: takes one ... | 44.028302 | 151 | 0.532998 | import jinja2
import os
import pathlib
import tempfile
from vtam.utils.FileParams import FileParams
from vtam.utils.PathManager import PathManager
from vtam.utils.Singleton import Singleton
class RunnerWopmars(Singleton):
def __init__(self, command, cli_args_dic):
self.command = command
self.cl... | true | true |
f75aedef7bb59676c0f9d3cef3a0dcc4a9a1ef3b | 7,891 | py | Python | teuthology/test/test_nuke.py | shrek-github/teuthology | 5a89fb217aaf2cd7948f7419f431230ab25053c6 | [
"MIT"
] | null | null | null | teuthology/test/test_nuke.py | shrek-github/teuthology | 5a89fb217aaf2cd7948f7419f431230ab25053c6 | [
"MIT"
] | 1 | 2020-03-05T03:00:08.000Z | 2020-03-05T03:00:08.000Z | teuthology/test/test_nuke.py | shrek-github/teuthology | 5a89fb217aaf2cd7948f7419f431230ab25053c6 | [
"MIT"
] | 1 | 2020-03-04T03:04:06.000Z | 2020-03-04T03:04:06.000Z | import datetime
import json
import os
import pytest
import subprocess
from mock import patch, Mock, DEFAULT
from teuthology import nuke
from teuthology import misc
from teuthology.config import config
class TestNuke(object):
#@pytest.mark.skipif('OS_AUTH_URL' not in os.environ,
# reason=... | 33.866953 | 85 | 0.490939 | import datetime
import json
import os
import pytest
import subprocess
from mock import patch, Mock, DEFAULT
from teuthology import nuke
from teuthology import misc
from teuthology.config import config
class TestNuke(object):
def test_stale_openstack_volumes(self):
ctx = Mock()
ctx.teuth... | true | true |
f75aef27b08c20cde9e42b88d25434d9c7e5324d | 17,363 | py | Python | tests/test_pascal_style_byte_stream.py | scottcwang/openssh_key_parser | f8ba2b841620abd9166e99176e033111daaf0570 | [
"MIT"
] | 15 | 2020-08-15T02:34:34.000Z | 2022-03-27T05:41:24.000Z | tests/test_pascal_style_byte_stream.py | scottcwang/openssh_key_parser | f8ba2b841620abd9166e99176e033111daaf0570 | [
"MIT"
] | 3 | 2022-01-26T23:38:10.000Z | 2022-01-30T15:41:06.000Z | tests/test_pascal_style_byte_stream.py | scottcwang/openssh_key_parser | f8ba2b841620abd9166e99176e033111daaf0570 | [
"MIT"
] | 1 | 2022-01-27T10:47:26.000Z | 2022-01-27T10:47:26.000Z | import pytest
from openssh_key.pascal_style_byte_stream import (
PascalStyleByteStream,
PascalStyleFormatInstruction,
PascalStyleFormatInstructionStringLengthSize
)
def test_read_fixed_bytes():
test_bytes = b'\x01\x02\x03\x04'
byte_stream = PascalStyleByteStream(test_bytes)
result = byte_stre... | 30.039792 | 75 | 0.666878 | import pytest
from openssh_key.pascal_style_byte_stream import (
PascalStyleByteStream,
PascalStyleFormatInstruction,
PascalStyleFormatInstructionStringLengthSize
)
def test_read_fixed_bytes():
test_bytes = b'\x01\x02\x03\x04'
byte_stream = PascalStyleByteStream(test_bytes)
result = byte_stre... | true | true |
f75aeffcdcd555f7d45c3e9c82740e9ca797b2a5 | 434 | py | Python | gdksite/base/migrations/0027_sponsor_category.py | vgrivtsov/moygdk | 74d63299c7326bcae92a17b61d978ad91f0d5552 | [
"MIT"
] | null | null | null | gdksite/base/migrations/0027_sponsor_category.py | vgrivtsov/moygdk | 74d63299c7326bcae92a17b61d978ad91f0d5552 | [
"MIT"
] | 17 | 2020-02-11T23:35:05.000Z | 2022-03-11T23:39:52.000Z | gdksite/base/migrations/0027_sponsor_category.py | vgrivtsov/moygdk | 74d63299c7326bcae92a17b61d978ad91f0d5552 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-07-09 13:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0026_auto_20190709_1604'),
]
operations = [
migrations.AddField(
model_name='sponsor',
name='category',
... | 22.842105 | 100 | 0.617512 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0026_auto_20190709_1604'),
]
operations = [
migrations.AddField(
model_name='sponsor',
name='category',
field=models.CharField(blank=True, max_l... | true | true |
f75af039a99a71a2f3fed2b9f6ee172033a5bb3f | 52,098 | py | Python | SiriusTip.py | demartini/SiriusTipBot-Telegram | 8823364a340f1f667027cea46363c822a5ef6a44 | [
"MIT"
] | 1 | 2020-12-16T14:04:56.000Z | 2020-12-16T14:04:56.000Z | SiriusTip.py | demartini/SiriusTipBot-Telegram | 8823364a340f1f667027cea46363c822a5ef6a44 | [
"MIT"
] | 15 | 2021-02-22T07:42:09.000Z | 2022-03-08T18:05:08.000Z | SiriusTip.py | demartini/SiriusTipBot-Telegram | 8823364a340f1f667027cea46363c822a5ef6a44 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
import emoji
from telegram.ext import Updater
from telegram.ext import CommandHandler, CallbackQueryHandler, MessageHandler
from telegram.ext import filters
from telegram import ParseMode, InlineKeyboardButton, InlineKeyboardMarkup
from SiriusRPC import SiriusRPC, Wrapper as RPCWrapper... | 43.52381 | 132 | 0.470152 |
import emoji
from telegram.ext import Updater
from telegram.ext import CommandHandler, CallbackQueryHandler, MessageHandler
from telegram.ext import filters
from telegram import ParseMode, InlineKeyboardButton, InlineKeyboardMarkup
from SiriusRPC import SiriusRPC, Wrapper as RPCWrapper
from HelperFunctions import *
im... | true | true |
f75af047f7b45ae5610dafbfb2f0de82ce5247f1 | 1,093 | py | Python | ttscripts/user-unfollow.py | adversary-org/twython-tools | 57dbd1645eab37366c3073fc38649dc2705e1b86 | [
"BSD-3-Clause"
] | 5 | 2016-02-24T16:39:57.000Z | 2020-03-06T05:57:29.000Z | ttscripts/user-unfollow.py | Hasimir/twython-tools | 57dbd1645eab37366c3073fc38649dc2705e1b86 | [
"BSD-3-Clause"
] | 1 | 2016-05-06T21:06:27.000Z | 2020-05-13T13:14:06.000Z | ttscripts/user-unfollow.py | Hasimir/twython-tools | 57dbd1645eab37366c3073fc38649dc2705e1b86 | [
"BSD-3-Clause"
] | 1 | 2016-06-10T09:11:57.000Z | 2016-06-10T09:11:57.000Z | #!/usr/bin/env python3
##
# Copyright (C) Benjamin D. McGinnes, 2013-2017
# ben@adversary.org
# OpenPGP/GPG key: 0x321E4E2373590E5D
#
# Version: 0.0.1
#
# BTC: 1KvKMVnyYgLxU1HnLQmbWaMpDx3Dz15DVU
#
#
#
# Requirements:
#
# * Python 3.4 or later.
# * Converted from scripts initially developed with Python 2.7.x.
#
# O... | 19.872727 | 71 | 0.713632 |
from license import __author__
from license import __copyright__
from license import __copyrighta__
from license import __license__
__version__ = "0.0.1"
from license import __bitcoin__
import sys
from twython import Twython, TwythonError
from config import *
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUT... | true | true |
f75af0dfae9c8b0316a6e1ae2e1c54e44f1eb5d3 | 3,348 | py | Python | bunkai/base/annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | bunkai/base/annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | bunkai/base/annotator.py | t-yamamura/bunkai | 6a6da28329fbdde2a53176740d403ef96fab4f28 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import typing
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import Callable, Iterator, List, Optional
from bunkai.base.annotation import Annotations, SpanAnnotation
def func_filter_span(spans_wide: typing.List[SpanAnnotation],
spans_narrow: t... | 33.818182 | 116 | 0.668757 | import typing
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import Callable, Iterator, List, Optional
from bunkai.base.annotation import Annotations, SpanAnnotation
def func_filter_span(spans_wide: typing.List[SpanAnnotation],
spans_narrow: typing.List[SpanAnnotati... | true | true |
f75af0f1cf954982958b4d3f8bccdb9263a675a8 | 441 | py | Python | 18917_v2.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | 18917_v2.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | 18917_v2.py | WaiNaat/BOJ-Python | 3365ef090c7dcf6e6a598fea0b25c416a5a3e01b | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
# input
m = int(input())
sum_val = 0
xor_val = 0
for _ in range(m):
query = tuple(map(int, input().split()))
# process & output
'''
수열의 순서는 지킬 필요가 없다.
애초에 수열일 필요가 없음.
출력값은 결국 합 아니면 xor니까.
xor의 역연산은 xor?
'''
if query[0] == 1:
sum_val += query[1]
xor_val ^= query[1]
elif... | 17.64 | 41 | 0.61678 | import sys
input = sys.stdin.readline
m = int(input())
sum_val = 0
xor_val = 0
for _ in range(m):
query = tuple(map(int, input().split()))
if query[0] == 1:
sum_val += query[1]
xor_val ^= query[1]
elif query[0] == 2:
sum_val -= query[1]
xor_val ^= query[1]
elif query[0] == 3:
print(sum_val)
else:
print... | true | true |
f75af1d5e834f92b4d597f0e902c80709dfa5915 | 2,169 | py | Python | examples/basic.py | pieckenst/ForkLink | 92b024c59a31c08a08469bf985e38d8d0c65f988 | [
"MIT"
] | null | null | null | examples/basic.py | pieckenst/ForkLink | 92b024c59a31c08a08469bf985e38d8d0c65f988 | [
"MIT"
] | 1 | 2021-10-30T21:42:11.000Z | 2021-10-30T21:42:11.000Z | examples/basic.py | pieckenst/ForkLink | 92b024c59a31c08a08469bf985e38d8d0c65f988 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import forklink
class Bot(commands.Bot):
def __init__(self):
super(Bot, self).__init__(command_prefix=["audio ", "wave ", "aw "])
self.add_cog(Music(self))
async def on_ready(self):
print(f"Logged in as {self.user.name} | {self.user.id... | 30.549296 | 119 | 0.607653 | import discord
from discord.ext import commands
import forklink
class Bot(commands.Bot):
def __init__(self):
super(Bot, self).__init__(command_prefix=["audio ", "wave ", "aw "])
self.add_cog(Music(self))
async def on_ready(self):
print(f"Logged in as {self.user.name} | {self.user.id... | true | true |
f75af27b44048dedd2ef45ada677eeac3552cf7a | 2,829 | py | Python | slack_cleaner/oauth.py | Elrohil44/slack-cleaner | 1fcd4fec5075e90c7cf8d8b66f4111aa6f51f3ee | [
"MIT"
] | null | null | null | slack_cleaner/oauth.py | Elrohil44/slack-cleaner | 1fcd4fec5075e90c7cf8d8b66f4111aa6f51f3ee | [
"MIT"
] | null | null | null | slack_cleaner/oauth.py | Elrohil44/slack-cleaner | 1fcd4fec5075e90c7cf8d8b66f4111aa6f51f3ee | [
"MIT"
] | null | null | null | import os
import webbrowser
from slack_sdk import WebClient
from slack_sdk.oauth import AuthorizeUrlGenerator
from slack_sdk.oauth.state_store import FileOAuthStateStore
from flask import Flask, request, make_response
from threading import Timer
from slack_cleaner.cleaner import start
client_secret = os.environ["SL... | 39.291667 | 254 | 0.687522 | import os
import webbrowser
from slack_sdk import WebClient
from slack_sdk.oauth import AuthorizeUrlGenerator
from slack_sdk.oauth.state_store import FileOAuthStateStore
from flask import Flask, request, make_response
from threading import Timer
from slack_cleaner.cleaner import start
client_secret = os.environ["SL... | true | true |
f75af3c382b8e3975a05e465a284c8f447619bcc | 1,500 | py | Python | setup.py | iainsmith/xcrun | bcbccfcfec5a466b951687c19e940edaefacaae3 | [
"MIT"
] | null | null | null | setup.py | iainsmith/xcrun | bcbccfcfec5a466b951687c19e940edaefacaae3 | [
"MIT"
] | null | null | null | setup.py | iainsmith/xcrun | bcbccfcfec5a466b951687c19e940edaefacaae3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from os import path
from setuptools import setup, find_packages
import isim
def run_setup():
"""Run package setup."""
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
try:
with open(path.join(here, 'README.md')) as f:
... | 29.411765 | 63 | 0.591333 |
from os import path
from setuptools import setup, find_packages
import isim
def run_setup():
here = path.abspath(path.dirname(__file__))
try:
with open(path.join(here, 'README.md')) as f:
long_description = f.read()
except:
long_description = None
setup(
... | true | true |
f75af5022e0eb50fa81a076adfc8406cb2df9811 | 13,519 | py | Python | networkx/algorithms/dag.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/dag.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/dag.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | 1 | 2020-09-11T06:41:14.000Z | 2020-09-11T06:41:14.000Z | # -*- coding: utf-8 -*-
"""Algorithms for directed acyclic graphs (DAGs)."""
# Copyright (C) 2006-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from fractions import gcd
import heapq
import networkx a... | 27.989648 | 105 | 0.604704 | from fractions import gcd
import heapq
import networkx as nx
from networkx.utils import consume, arbitrary_element
from networkx.utils.decorators import *
__author__ = """\n""".join(['Aric Hagberg <aric.hagberg@gmail.com>',
'Dan Schult (dschult@colgate.edu)',
'B... | true | true |
f75af53010fbc8052b9b46c80d077af157c59395 | 11,713 | py | Python | keras_self_attention/seq_self_attention.py | CyberZHG/keras-global-self-attention | f3bf21dbb1f3251b5417a8bb254dd91807b1aec5 | [
"MIT"
] | null | null | null | keras_self_attention/seq_self_attention.py | CyberZHG/keras-global-self-attention | f3bf21dbb1f3251b5417a8bb254dd91807b1aec5 | [
"MIT"
] | null | null | null | keras_self_attention/seq_self_attention.py | CyberZHG/keras-global-self-attention | f3bf21dbb1f3251b5417a8bb254dd91807b1aec5 | [
"MIT"
] | null | null | null | from tensorflow import keras
from tensorflow.keras import backend as K
class SeqSelfAttention(keras.layers.Layer):
ATTENTION_TYPE_ADD = 'additive'
ATTENTION_TYPE_MUL = 'multiplicative'
def __init__(self,
units=32,
attention_width=None,
attention_type=AT... | 48.60166 | 109 | 0.606079 | from tensorflow import keras
from tensorflow.keras import backend as K
class SeqSelfAttention(keras.layers.Layer):
ATTENTION_TYPE_ADD = 'additive'
ATTENTION_TYPE_MUL = 'multiplicative'
def __init__(self,
units=32,
attention_width=None,
attention_type=AT... | true | true |
f75af59f9381394660178c137505b1d7784fe673 | 398 | py | Python | diary/migrations/0002_job_keyword_string.py | tbrlpld/CAEJobDiary | 16676b3eaa56aafdf54579d19baa6540375d91e4 | [
"MIT"
] | null | null | null | diary/migrations/0002_job_keyword_string.py | tbrlpld/CAEJobDiary | 16676b3eaa56aafdf54579d19baa6540375d91e4 | [
"MIT"
] | 2 | 2020-06-06T01:37:33.000Z | 2020-06-06T04:16:18.000Z | diary/migrations/0002_job_keyword_string.py | tbrlpld/CAEJobDiary | 16676b3eaa56aafdf54579d19baa6540375d91e4 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.9 on 2019-05-11 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('diary', '0001_squashed_0020_auto_20190424_1603'),
]
operations = [
migrations.AddField(
model_name='job',
name='keyw... | 20.947368 | 59 | 0.610553 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('diary', '0001_squashed_0020_auto_20190424_1603'),
]
operations = [
migrations.AddField(
model_name='job',
name='keyword_string',
field=models.TextField(... | true | true |
f75af61799b53dcc9570931dc0802abc53de9cfc | 5,642 | py | Python | pyprep/removeTrend.py | mscheltienne/pyprep | 82920228a1bfe46a8f8c04443547cc2726d3d189 | [
"MIT"
] | null | null | null | pyprep/removeTrend.py | mscheltienne/pyprep | 82920228a1bfe46a8f8c04443547cc2726d3d189 | [
"MIT"
] | null | null | null | pyprep/removeTrend.py | mscheltienne/pyprep | 82920228a1bfe46a8f8c04443547cc2726d3d189 | [
"MIT"
] | null | null | null | """High-pass filter and locally detrend the EEG signal."""
import logging
import mne
import numpy as np
from pyprep.utils import _eeglab_create_highpass, _eeglab_fir_filter
def removeTrend(
EEG,
sample_rate,
detrendType="high pass",
detrendCutoff=1.0,
detrendChannels=None,
matlab_strict=Fals... | 32.24 | 86 | 0.564162 | import logging
import mne
import numpy as np
from pyprep.utils import _eeglab_create_highpass, _eeglab_fir_filter
def removeTrend(
EEG,
sample_rate,
detrendType="high pass",
detrendCutoff=1.0,
detrendChannels=None,
matlab_strict=False,
):
if len(EEG.shape) == 1:
EEG = np.reshape(... | true | true |
f75af64cb7e729c258694c30626c5159c98f49f9 | 18,634 | py | Python | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/utils/path.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-11-30T14:04:30.000Z | 2021-11-08T11:29:05.000Z | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/utils/path.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/utils/path.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-19T05:18:41.000Z | 2020-11-19T05:18:41.000Z | # encoding: utf-8
"""
Utilities for path handling.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this so... | 32.980531 | 89 | 0.629065 |
import os
import sys
import errno
import shutil
import random
import tempfile
import warnings
from hashlib import md5
import glob
import IPython
from IPython.testing.skipdoctest import skip_doctest
from IPython.utils.process import system
from IPython.utils.importstring import import_item
from IPython.utils import ... | true | true |
f75af665c80be57d4c10c1f300174722e2777583 | 6,271 | py | Python | transformers/src/transformers/data/processors/xfact.py | casszhao/x-fact | 0b2827dcdd47a050b8d5169de43fdb3ae2aab55d | [
"MIT"
] | 13 | 2021-06-18T08:18:32.000Z | 2022-02-18T22:17:11.000Z | transformers/src/transformers/data/processors/xfact.py | casszhao/x-fact | 0b2827dcdd47a050b8d5169de43fdb3ae2aab55d | [
"MIT"
] | 1 | 2021-06-18T01:38:40.000Z | 2021-06-18T01:38:40.000Z | transformers/src/transformers/data/processors/xfact.py | casszhao/x-fact | 0b2827dcdd47a050b8d5169de43fdb3ae2aab55d | [
"MIT"
] | 4 | 2021-06-18T06:22:29.000Z | 2022-03-25T22:37:25.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 37.106509 | 174 | 0.602934 |
import logging
import os
import random
from .utils import DataProcessor, InputExample
logger = logging.getLogger(__name__)
def get_metadata(line):
claimant = line[-3].strip()
review_date = line[-4].strip()
language = line[0].strip()
site = line[1].strip()
claim_date = line[-5].strip()
s =... | true | true |
f75af69591574b1d4848363e7ce878f65daaf655 | 334 | py | Python | appengine/provider.py | openfinch/masonite-appengine | c534ea3dd95160d3a55d1d4963dd54c938b1b980 | [
"MIT"
] | 1 | 2018-08-09T02:51:54.000Z | 2018-08-09T02:51:54.000Z | appengine/provider.py | openfinch/masonite-appengine | c534ea3dd95160d3a55d1d4963dd54c938b1b980 | [
"MIT"
] | null | null | null | appengine/provider.py | openfinch/masonite-appengine | c534ea3dd95160d3a55d1d4963dd54c938b1b980 | [
"MIT"
] | null | null | null | """ The Mail ServiceProvider for AppEngine Mail API """
from masonite.provider import ServiceProvider
from .driver import MailAppEngineDriver
class MailAppEngineProvider(ServiceProvider):
wsgi = False
def register(self):
self.app.bind('MailAppEngineDriver', MailAppEngineDriver)
def boot(self):... | 20.875 | 65 | 0.736527 |
from masonite.provider import ServiceProvider
from .driver import MailAppEngineDriver
class MailAppEngineProvider(ServiceProvider):
wsgi = False
def register(self):
self.app.bind('MailAppEngineDriver', MailAppEngineDriver)
def boot(self):
pass
| true | true |
f75af69a3063fae6b7a387b8fc3fcdc687e046fa | 2,127 | py | Python | tests/test_model.py | oskarfernlund/data-poisoning-attacks | f45a90fe6057e1cf158ce85a824626acd5f34b64 | [
"MIT"
] | null | null | null | tests/test_model.py | oskarfernlund/data-poisoning-attacks | f45a90fe6057e1cf158ce85a824626acd5f34b64 | [
"MIT"
] | null | null | null | tests/test_model.py | oskarfernlund/data-poisoning-attacks | f45a90fe6057e1cf158ce85a824626acd5f34b64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for out-of-the-box model classes.
"""
# =============================================================================
# IMPORTS AND DEPENDENCIES
# =============================================================================
import pytest
from niteshad... | 33.761905 | 88 | 0.550541 |
import pytest
from niteshade.models import IrisClassifier, MNISTClassifier, CifarClassifier
from niteshade.simulation import Simulator
from niteshade.utils import train_test_iris, train_test_MNIST, train_test_cifar
def test_iris():
batch_size = 5
num_episodes = 10
X_train, y_train, X_test, y_t... | true | true |
f75af79a751454b3d816849f5563d304296bc2c6 | 3,070 | py | Python | talos/parameters/ParamGrid.py | FlorianBury/talos | 30f7af4d1f628364f8e8a2e983f72b2631cee6d9 | [
"MIT"
] | null | null | null | talos/parameters/ParamGrid.py | FlorianBury/talos | 30f7af4d1f628364f8e8a2e983f72b2631cee6d9 | [
"MIT"
] | null | null | null | talos/parameters/ParamGrid.py | FlorianBury/talos | 30f7af4d1f628364f8e8a2e983f72b2631cee6d9 | [
"MIT"
] | null | null | null | from numpy import arange, unique, array, column_stack, concatenate
from itertools import product
from ..reducers.sample_reducer import sample_reducer
class ParamGrid:
'''Suite for handling parameters internally within Talos
Takes as input the parameter dictionary from the user, and
returns a class obje... | 29.519231 | 83 | 0.614007 | from numpy import arange, unique, array, column_stack, concatenate
from itertools import product
from ..reducers.sample_reducer import sample_reducer
class ParamGrid:
def __init__(self, main_self):
self.main_self = main_self
self._p = self._param_input_conversion()
se... | true | true |
f75af95027115b4ef308a73436fbf7bd166abc06 | 274 | py | Python | src/apps/account/choices.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 4 | 2018-10-31T19:09:50.000Z | 2020-09-29T13:16:28.000Z | src/apps/account/choices.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 70 | 2018-11-02T13:55:32.000Z | 2022-03-18T13:06:45.000Z | src/apps/account/choices.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 2 | 2018-11-05T09:59:26.000Z | 2020-08-26T19:37:41.000Z | from django.utils.translation import gettext_lazy as _
class AccountTypeChoices:
AUTHOR = "AUTHOR"
MANAGER = "MANAGER"
CLIENT = "CLIENT"
USER_CHOICES = (
(AUTHOR, _("Author")),
(MANAGER, _("Manager")),
(CLIENT, _("Client")),
)
| 19.571429 | 54 | 0.587591 | from django.utils.translation import gettext_lazy as _
class AccountTypeChoices:
AUTHOR = "AUTHOR"
MANAGER = "MANAGER"
CLIENT = "CLIENT"
USER_CHOICES = (
(AUTHOR, _("Author")),
(MANAGER, _("Manager")),
(CLIENT, _("Client")),
)
| true | true |
f75af981eba0a228fcd87782ef35cee111447306 | 14,489 | py | Python | bokeh/charts/stats.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T13:05:55.000Z | 2021-04-03T13:05:55.000Z | bokeh/charts/stats.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | null | null | null | bokeh/charts/stats.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | null | null | null | """ Statistical methods used to define or modify position of glyphs.
References:
Wilkinson L. The Grammer of Graphics, sections 7, 7.1
Method Types:
- Bin: Partitions a space before statistical calculation
- Summary: Produces a single value comprising a statistical summary
- Region: Produces two value... | 30.959402 | 120 | 0.611429 |
from __future__ import absolute_import
import numpy as np
import pandas as pd
from bokeh.models.sources import ColumnDataSource
from bokeh.core.properties import (HasProps, Float, Either, String, Date, Datetime, Int,
Bool, List, Instance)
from .properties import Column, EitherColumn, Co... | true | true |
f75af9d9cdb6fd2cf5f7eb347e47ed2d4a552fad | 12,934 | py | Python | pydub/utils.py | rocabrera/pydub | 3d88a5bae1a25a950c454f73a7d1a84b90697d68 | [
"MIT"
] | null | null | null | pydub/utils.py | rocabrera/pydub | 3d88a5bae1a25a950c454f73a7d1a84b90697d68 | [
"MIT"
] | null | null | null | pydub/utils.py | rocabrera/pydub | 3d88a5bae1a25a950c454f73a7d1a84b90697d68 | [
"MIT"
] | null | null | null | from __future__ import division
import json
import os
import re
import sys
from subprocess import Popen, PIPE
from math import log, ceil
from tempfile import TemporaryFile
from warnings import warn
from functools import wraps
try:
import audioop
except ImportError:
import pyaudioop as audioop
if sys.version_... | 28.935123 | 144 | 0.610252 | from __future__ import division
import json
import os
import re
import sys
from subprocess import Popen, PIPE
from math import log, ceil
from tempfile import TemporaryFile
from warnings import warn
from functools import wraps
try:
import audioop
except ImportError:
import pyaudioop as audioop
if sys.version_... | true | true |
f75afa10e2695885565d9f4b279c89399cd9abc4 | 1,692 | py | Python | cohesity_management_sdk/models/oracle_session.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/oracle_session.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/oracle_session.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class OracleSession(object):
"""Implementation of the 'Oracle Session.' model.
Specifies information about session configuration for an Oracle host.
Attributes:
location (string): Location is the path where Oracle is installed.
syst... | 28.2 | 81 | 0.630024 |
class OracleSession(object):
_names = {
"location":'location',
"system_identifier":'systemIdentifier'
}
def __init__(self,
location=None,
system_identifier=None):
self.location = location
self.system_identifier = system_iden... | true | true |
f75afa61504ee37b2103e0319553abb9faed11d4 | 1,086 | py | Python | retriever/lib/__init__.py | Jay-Iam/retriever | 26e321cdb86fcb4cb78184c4bf5c0c6902a97d2c | [
"MIT"
] | null | null | null | retriever/lib/__init__.py | Jay-Iam/retriever | 26e321cdb86fcb4cb78184c4bf5c0c6902a97d2c | [
"MIT"
] | null | null | null | retriever/lib/__init__.py | Jay-Iam/retriever | 26e321cdb86fcb4cb78184c4bf5c0c6902a97d2c | [
"MIT"
] | null | null | null | """retriever.lib contains the core Data Retriever modules."""
from .create_scripts import create_package
from .datasets import datasets
from .datasets import dataset_names
from .download import download
from .install import install_csv
from .install import install_json
from .install import install_msaccess
from .insta... | 37.448276 | 84 | 0.805709 |
from .create_scripts import create_package
from .datasets import datasets
from .datasets import dataset_names
from .download import download
from .install import install_csv
from .install import install_json
from .install import install_msaccess
from .install import install_mysql
from .install import install_postgres
... | true | true |
f75afc14e991abe6a5c563816a76f78d2da2faec | 10,284 | py | Python | src/dataset/kitti.py | floft/squeezeDet | e136f1abb4d31482d40c8b169e19cdcfbef2e9f8 | [
"BSD-2-Clause"
] | 812 | 2016-12-11T02:59:15.000Z | 2022-02-23T14:35:45.000Z | src/dataset/kitti.py | Tony-Hou/squeezeDet | e7c0860eb1d141729cf02a2ec9cafc0cfb4a21aa | [
"BSD-2-Clause"
] | 128 | 2016-12-15T08:18:38.000Z | 2022-03-11T23:18:57.000Z | src/dataset/kitti.py | Tony-Hou/squeezeDet | e7c0860eb1d141729cf02a2ec9cafc0cfb4a21aa | [
"BSD-2-Clause"
] | 363 | 2016-12-11T04:21:09.000Z | 2022-03-05T17:26:45.000Z | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""Image data base class for kitti"""
import cv2
import os
import numpy as np
import subprocess
from dataset.imdb import imdb
from utils.util import bbox_transform_inv, batch_iou
class kitti(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init_... | 34.626263 | 82 | 0.584306 |
import cv2
import os
import numpy as np
import subprocess
from dataset.imdb import imdb
from utils.util import bbox_transform_inv, batch_iou
class kitti(imdb):
def __init__(self, image_set, data_path, mc):
imdb.__init__(self, 'kitti_'+image_set, mc)
self._image_set = image_set
self._data_root_path = ... | true | true |
f75afc22a5a3a023dd964fd11da45a19589ed744 | 20 | py | Python | Exercicios/ex001.py | vgabriel10/meus-exercicios-python | eef75c09fcaa57bf4a11e13736485f1218912778 | [
"MIT"
] | null | null | null | Exercicios/ex001.py | vgabriel10/meus-exercicios-python | eef75c09fcaa57bf4a11e13736485f1218912778 | [
"MIT"
] | null | null | null | Exercicios/ex001.py | vgabriel10/meus-exercicios-python | eef75c09fcaa57bf4a11e13736485f1218912778 | [
"MIT"
] | null | null | null | print('Olá Mundo')
| 6.666667 | 18 | 0.65 | print('Olá Mundo')
| true | true |
f75afc2b1d0b5796f05f330123f81e011f74fb04 | 307 | py | Python | drnalpha/finder/templatetags/finder_tags.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | null | null | null | drnalpha/finder/templatetags/finder_tags.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | null | null | null | drnalpha/finder/templatetags/finder_tags.py | UKGovernmentBEIS/BRE_DigitalRegulationNavigator_Alpha | bfa6d08212bc18034b20b9c922a554a6e1ddd0f1 | [
"MIT"
] | 1 | 2021-04-21T09:41:43.000Z | 2021-04-21T09:41:43.000Z | from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def remove_filter(context, name, value):
data = context["request"].GET.copy()
values = data.getlist(name)
values.remove(str(value))
data.setlist(name, values)
return data.urlencode()
| 20.466667 | 40 | 0.716612 | from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def remove_filter(context, name, value):
data = context["request"].GET.copy()
values = data.getlist(name)
values.remove(str(value))
data.setlist(name, values)
return data.urlencode()
| true | true |
f75afcd0e32f651f7c5bbd94aacf425f6bdbdacd | 450 | py | Python | fb/split_array_to_equal.py | felixchr/leetcode | 51dd41c5e6fdb96af65ac8c7069f4216ed078547 | [
"Apache-2.0"
] | null | null | null | fb/split_array_to_equal.py | felixchr/leetcode | 51dd41c5e6fdb96af65ac8c7069f4216ed078547 | [
"Apache-2.0"
] | null | null | null | fb/split_array_to_equal.py | felixchr/leetcode | 51dd41c5e6fdb96af65ac8c7069f4216ed078547 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
def find_equal_index(mylist):
len_of_list = len(mylist)
if len_of_list <= 1:
raise ValueError('Invalid list supplied')
sum1 = mylist[0]
sum2 = sum(mylist[1:])
if sum1 == sum2:
return 1
for pointer in range(1, len_of_list-1):
if sum1 == sum2:
... | 26.470588 | 71 | 0.586667 |
def find_equal_index(mylist):
len_of_list = len(mylist)
if len_of_list <= 1:
raise ValueError('Invalid list supplied')
sum1 = mylist[0]
sum2 = sum(mylist[1:])
if sum1 == sum2:
return 1
for pointer in range(1, len_of_list-1):
if sum1 == sum2:
return pointer, ... | true | true |
f75b009beb7f0ba58a43001d7623faf0c77aee90 | 11,145 | py | Python | tests/functional/test_wheel.py | davidhewitt/pip | 5ee7caf92ae6135b8ae8fdad4cd2cc28d5f81b8a | [
"MIT"
] | null | null | null | tests/functional/test_wheel.py | davidhewitt/pip | 5ee7caf92ae6135b8ae8fdad4cd2cc28d5f81b8a | [
"MIT"
] | 1 | 2020-09-25T18:54:26.000Z | 2020-09-25T18:54:26.000Z | tests/functional/test_wheel.py | davidhewitt/pip | 5ee7caf92ae6135b8ae8fdad4cd2cc28d5f81b8a | [
"MIT"
] | 2 | 2020-11-19T17:45:20.000Z | 2020-11-19T17:45:34.000Z | """'pip wheel' tests"""
import os
import re
import sys
from os.path import exists
import pytest
from pip._internal.cli.status_codes import ERROR
from tests.lib import pyversion # noqa: F401
@pytest.fixture(autouse=True)
def auto_with_wheel(with_wheel):
pass
def add_files_to_dist_directory(folder):
(folde... | 34.187117 | 79 | 0.669089 | import os
import re
import sys
from os.path import exists
import pytest
from pip._internal.cli.status_codes import ERROR
from tests.lib import pyversion
@pytest.fixture(autouse=True)
def auto_with_wheel(with_wheel):
pass
def add_files_to_dist_directory(folder):
(folder / 'dist').mkdir(parents=True)
(... | true | true |
f75b00ea95157630b4830fb0129443da217aa234 | 3,529 | py | Python | tests/test_hooks/conan-center/test_library_install.py | conan-io/plugins | f4732622ecaf803b01f556da1eef33a48ab7847a | [
"MIT"
] | 1 | 2018-10-09T16:43:48.000Z | 2018-10-09T16:43:48.000Z | tests/test_hooks/conan-center/test_library_install.py | conan-io/plugins | f4732622ecaf803b01f556da1eef33a48ab7847a | [
"MIT"
] | 5 | 2018-10-10T18:04:15.000Z | 2018-10-23T08:39:44.000Z | tests/test_hooks/conan-center/test_library_install.py | conan-io/plugins | f4732622ecaf803b01f556da1eef33a48ab7847a | [
"MIT"
] | 3 | 2018-10-09T16:43:54.000Z | 2018-10-10T16:36:20.000Z | import os
import textwrap
from conans import tools
from tests.utils.test_cases.conan_client import ConanClientTestCase
class TestInstalledLibraries(ConanClientTestCase):
conanfile = textwrap.dedent("""\
from conans import ConanFile
import os
class AConan(ConanFile):
settings... | 44.670886 | 109 | 0.598753 | import os
import textwrap
from conans import tools
from tests.utils.test_cases.conan_client import ConanClientTestCase
class TestInstalledLibraries(ConanClientTestCase):
conanfile = textwrap.dedent("""\
from conans import ConanFile
import os
class AConan(ConanFile):
settings... | true | true |
f75b0184a8927eb957ebbad0519c71b8e3c27a18 | 353 | py | Python | catalog/migrations/0008_alter_catalog_unique_together.py | da-semenov/komtek | 9ac5903d3c1cf10811217e36ed5f10e8bc463ebc | [
"BSD-3-Clause"
] | null | null | null | catalog/migrations/0008_alter_catalog_unique_together.py | da-semenov/komtek | 9ac5903d3c1cf10811217e36ed5f10e8bc463ebc | [
"BSD-3-Clause"
] | null | null | null | catalog/migrations/0008_alter_catalog_unique_together.py | da-semenov/komtek | 9ac5903d3c1cf10811217e36ed5f10e8bc463ebc | [
"BSD-3-Clause"
] | 1 | 2021-06-24T14:03:32.000Z | 2021-06-24T14:03:32.000Z | # Generated by Django 3.2 on 2021-06-11 13:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('catalog', '0007_alter_catalog_slug'),
]
operations = [
migrations.AlterUniqueTogether(
name='catalog',
unique_together={('name... | 19.611111 | 50 | 0.600567 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('catalog', '0007_alter_catalog_slug'),
]
operations = [
migrations.AlterUniqueTogether(
name='catalog',
unique_together={('name', 'version')},
),
]
| true | true |
f75b01cc9f9b04f800eff05a55cbfb0fe7f0fa5a | 5,854 | py | Python | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from django.db.models import OuterRef, Subquery, Q
from extras.models.tags import TaggedItem
from utilities.query_functions import EmptyGroupByJSONBAgg, OrderableJSONBAgg
from utilities.querysets import RestrictedQuerySet
class CustomFieldQueryset:
"""
Annotate custom fie... | 39.554054 | 115 | 0.619918 | from collections import OrderedDict
from django.db.models import OuterRef, Subquery, Q
from extras.models.tags import TaggedItem
from utilities.query_functions import EmptyGroupByJSONBAgg, OrderableJSONBAgg
from utilities.querysets import RestrictedQuerySet
class CustomFieldQueryset:
def __init__(self, queryset... | true | true |
f75b023890fb5730e6b8477e3235c7e2348d7780 | 16,797 | py | Python | onadata/apps/api/tests/viewsets/test_data_viewset.py | geohyd/kobocat | a3db181c13479de528141fe53c3d8cb3bb3468d7 | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/api/tests/viewsets/test_data_viewset.py | geohyd/kobocat | a3db181c13479de528141fe53c3d8cb3bb3468d7 | [
"BSD-2-Clause"
] | null | null | null | onadata/apps/api/tests/viewsets/test_data_viewset.py | geohyd/kobocat | a3db181c13479de528141fe53c3d8cb3bb3468d7 | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
import requests
from django.test import RequestFactory
from guardian.shortcuts import assign_perm, remove_perm
from rest_framework import status
from onadata.apps.api.viewsets.data_viewset import DataViewSet
from onada... | 40.572464 | 91 | 0.633625 | from __future__ import unicode_literals, print_function, division, absolute_import
import requests
from django.test import RequestFactory
from guardian.shortcuts import assign_perm, remove_perm
from rest_framework import status
from onadata.apps.api.viewsets.data_viewset import DataViewSet
from onadata.apps.api.view... | true | true |
f75b0277362c8975deb91cd6cfdca9cfc8eea720 | 8,691 | py | Python | src/.history/Test2/Hiwin_RT605_ArmCommand_Socket_20190627191433.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test2/Hiwin_RT605_ArmCommand_Socket_20190627191433.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | src/.history/Test2/Hiwin_RT605_ArmCommand_Socket_20190627191433.py | SamKaiYang/2019_Hiwin_Shaking | d599f8c87dc4da89eae266990d12eb3a8b0f3e16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... | 35.765432 | 167 | 0.584283 | import rospy
import os
import socket
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
from std_msgs.msg import ... | false | true |
f75b03a35eb8fbc493908878114086e8f2549c2f | 15,165 | py | Python | pagarmeapisdk/controllers/invoices_controller.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | pagarmeapisdk/controllers/invoices_controller.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | pagarmeapisdk/controllers/invoices_controller.py | pagarme/pagarme-python-sdk | 5a709ce54d46fc7326f73242700602c1c5a6bd26 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pagarmeapisdk
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
from pagarmeapisdk.api_helper import APIHelper
from pagarmeapisdk.configuration import Server
from pagarmeapisdk.controllers.base_controller import BaseController
from pagarm... | 36.89781 | 125 | 0.601451 |
from pagarmeapisdk.api_helper import APIHelper
from pagarmeapisdk.configuration import Server
from pagarmeapisdk.controllers.base_controller import BaseController
from pagarmeapisdk.models.get_invoice_response import GetInvoiceResponse
from pagarmeapisdk.models.list_invoices_response import ListInvoicesResponse... | true | true |
f75b04b46900e77e208490a77b986da3304fd64b | 1,251 | py | Python | application/core/models.py | DanishDanialZurkanain/recipe-app-api | 8f8dc22a9a24980cd35c9cf55c69d4893bf52e87 | [
"MIT"
] | null | null | null | application/core/models.py | DanishDanialZurkanain/recipe-app-api | 8f8dc22a9a24980cd35c9cf55c69d4893bf52e87 | [
"MIT"
] | null | null | null | application/core/models.py | DanishDanialZurkanain/recipe-app-api | 8f8dc22a9a24980cd35c9cf55c69d4893bf52e87 | [
"MIT"
] | null | null | null | """Core Model"""
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
"""User Manager"""
def create_user(self, email, password=None, **extra_fields):
"""Cre... | 29.785714 | 76 | 0.660272 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError('U... | true | true |
f75b04ea3aa01f3c454a6e034bb73b3e7b8ffc61 | 9,386 | py | Python | NST v1.3 (source)/main.py | nebelorz/NST | f8bb9410ab07b352b05fea5124e298be7ea47a1d | [
"MIT"
] | 5 | 2021-07-01T13:06:09.000Z | 2021-11-30T22:09:13.000Z | NST v1.3 (source)/main.py | nebelorz/NST | f8bb9410ab07b352b05fea5124e298be7ea47a1d | [
"MIT"
] | 1 | 2021-06-19T09:41:27.000Z | 2021-11-08T18:04:28.000Z | NST v1.3 (source)/main.py | nebelorz/NST | f8bb9410ab07b352b05fea5124e298be7ea47a1d | [
"MIT"
] | null | null | null | import time
import threading
import tkinter as tk
import functions
import find_window
import sys
from tkinter import messagebox
from tkinter import ttk
from ttkthemes import ThemedTk
from playsound import playsound
## VARs
build_version = 'v1.3'
build_title = ('NST', build_version)
build_contact = 'slack... | 34.634686 | 114 | 0.606009 | import time
import threading
import tkinter as tk
import functions
import find_window
import sys
from tkinter import messagebox
from tkinter import ttk
from ttkthemes import ThemedTk
from playsound import playsound
build_version = 'v1.3'
build_title = ('NST', build_version)
build_contact = 'slackertools@g... | true | true |
f75b051ef77a77ff0db01a3a383939fa84167e21 | 14,875 | py | Python | tests/units/fastsync/commons/test_fastsync_target_bigquery.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | null | null | null | tests/units/fastsync/commons/test_fastsync_target_bigquery.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | null | null | null | tests/units/fastsync/commons/test_fastsync_target_bigquery.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | null | null | null | import pytest
from unittest.mock import Mock, patch, ANY, mock_open
from google.cloud import bigquery
from pipelinewise.fastsync.commons.target_bigquery import FastSyncTargetBigquery
@pytest.fixture(name='query_result')
def fixture_query_result():
"""
Mocked Bigquery Run Query Results
"""
mocked_qr = M... | 52.01049 | 119 | 0.630454 | import pytest
from unittest.mock import Mock, patch, ANY, mock_open
from google.cloud import bigquery
from pipelinewise.fastsync.commons.target_bigquery import FastSyncTargetBigquery
@pytest.fixture(name='query_result')
def fixture_query_result():
mocked_qr = Mock()
mocked_qr.return_value = []
return mocke... | true | true |
f75b0734424051e66bc979b370b31fd64e8c306c | 676 | py | Python | Assignment-3/decision_tree_test.py | ZhangShiqiu1993/CSCI-567-machine-learning | 07144b299aeb9f29c304798549ef2d44fe1f4083 | [
"Apache-2.0"
] | null | null | null | Assignment-3/decision_tree_test.py | ZhangShiqiu1993/CSCI-567-machine-learning | 07144b299aeb9f29c304798549ef2d44fe1f4083 | [
"Apache-2.0"
] | null | null | null | Assignment-3/decision_tree_test.py | ZhangShiqiu1993/CSCI-567-machine-learning | 07144b299aeb9f29c304798549ef2d44fe1f4083 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from sklearn.metrics import accuracy_score
import json
import data_loader
import decision_tree
# load data
X_train, X_test, y_train, y_test = data_loader.discrete_2D_iris_dataset()
# set classifier
dTree = decision_tree.DecisionTree()
# training
dTree.train(X_train, y_train)
y_est_train = dTree.p... | 21.125 | 73 | 0.782544 | import numpy as np
from sklearn.metrics import accuracy_score
import json
import data_loader
import decision_tree
X_train, X_test, y_train, y_test = data_loader.discrete_2D_iris_dataset()
dTree = decision_tree.DecisionTree()
dTree.train(X_train, y_train)
y_est_train = dTree.predict(X_train)
train_accu = accuracy_sc... | true | true |
f75b074a6e308ffa4b0c5cc91fe60393c4e26627 | 2,792 | bzl | Python | tools/defaults.bzl | PendletonJones/rules_nodejs | 3c7a31630a5a4d63f4253c12cc93d1117b570d8f | [
"Apache-2.0"
] | 1 | 2020-09-23T12:03:02.000Z | 2020-09-23T12:03:02.000Z | tools/defaults.bzl | PendletonJones/rules_nodejs | 3c7a31630a5a4d63f4253c12cc93d1117b570d8f | [
"Apache-2.0"
] | null | null | null | tools/defaults.bzl | PendletonJones/rules_nodejs | 3c7a31630a5a4d63f4253c12cc93d1117b570d8f | [
"Apache-2.0"
] | null | null | null | """Wrappers around build rules
These set common default attributes and behaviors for our local repo
"""
load(
"@build_bazel_rules_nodejs//:index.bzl",
_COMMON_REPLACEMENTS = "COMMON_REPLACEMENTS",
_nodejs_test = "nodejs_test",
_pkg_npm = "pkg_npm",
)
load("@rules_codeowners//tools:codeowners.bzl", _co... | 30.347826 | 147 | 0.621777 |
load(
"@build_bazel_rules_nodejs//:index.bzl",
_COMMON_REPLACEMENTS = "COMMON_REPLACEMENTS",
_nodejs_test = "nodejs_test",
_pkg_npm = "pkg_npm",
)
load("@rules_codeowners//tools:codeowners.bzl", _codeowners = "codeowners")
load("@rules_pkg//:pkg.bzl", _pkg_tar = "pkg_tar")
load("//third_party/github.co... | true | true |
f75b07ab136d8ff61ea32fb3b8b1e1fb3c18a77c | 3,533 | py | Python | progress/__init__.py | skalkoto/progress | 32dc3db6f1686da3e765fdfd075068aeccd5691b | [
"0BSD"
] | null | null | null | progress/__init__.py | skalkoto/progress | 32dc3db6f1686da3e765fdfd075068aeccd5691b | [
"0BSD"
] | null | null | null | progress/__init__.py | skalkoto/progress | 32dc3db6f1686da3e765fdfd075068aeccd5691b | [
"0BSD"
] | null | null | null | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | 27.176923 | 90 | 0.577413 |
from __future__ import division
from math import ceil
from sys import stderr
from time import time
__version__ = '1.1'
class Infinite(object):
file = stderr
def __init__(self, *args, **kwargs):
self.ctx = {}
for key, val in kwargs.items():
if hasattr(self, key):
... | true | true |
f75b0847f866b53e3d984033dcdd031d02597205 | 578 | py | Python | setup.py | avryhof/kd2otl | 4ee98d021578263e9c7debac0ec216d60fd9b763 | [
"MIT"
] | null | null | null | setup.py | avryhof/kd2otl | 4ee98d021578263e9c7debac0ec216d60fd9b763 | [
"MIT"
] | null | null | null | setup.py | avryhof/kd2otl | 4ee98d021578263e9c7debac0ec216d60fd9b763 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='kd2otl',
version='0.0.1',
packages=['kd2otl'],
url='https://github.com/avryhof/kd2otl',
license='MIT',
author='Amos Vryhof',
author_email='amos@vryhofresearch.com',
description='My HAM Radio Website.',
classifiers=[
'Development St... | 25.130435 | 56 | 0.583045 | from setuptools import setup
setup(
name='kd2otl',
version='0.0.1',
packages=['kd2otl'],
url='https://github.com/avryhof/kd2otl',
license='MIT',
author='Amos Vryhof',
author_email='amos@vryhofresearch.com',
description='My HAM Radio Website.',
classifiers=[
'Development St... | true | true |
f75b09319e0ece3552e2d4ee2b3bf9bb952c7079 | 6,325 | py | Python | meta/halo2_map.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | meta/halo2_map.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | meta/halo2_map.py | holy-crust/reclaimer | 0aa693da3866ce7999c68d5f71f31a9c932cdb2c | [
"MIT"
] | null | null | null | import zlib
from reclaimer.h2.common_descs import *
from supyr_struct.defs.tag_def import TagDef
def tag_name_table_name_pointer(parent=None, new_value=None, **kwargs):
header = parent.parent.parent.parent
if new_value is None:
if parent.offset == -1:
return header.tag_name_tabl... | 28.61991 | 79 | 0.610119 | import zlib
from reclaimer.h2.common_descs import *
from supyr_struct.defs.tag_def import TagDef
def tag_name_table_name_pointer(parent=None, new_value=None, **kwargs):
header = parent.parent.parent.parent
if new_value is None:
if parent.offset == -1:
return header.tag_name_tabl... | true | true |
f75b0a1f1a582c46b036a5f7f1dd4aa98e2cf3be | 10,579 | py | Python | tests/models/test_gpu.py | ashwinb/pytorch-lightning | 89787947304a0db3a98a1ddd0e818a91a924e43f | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | ashwinb/pytorch-lightning | 89787947304a0db3a98a1ddd0e818a91a924e43f | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | ashwinb/pytorch-lightning | 89787947304a0db3a98a1ddd0e818a91a924e43f | [
"Apache-2.0"
] | 1 | 2021-11-19T01:51:19.000Z | 2021-11-19T01:51:19.000Z | import os
import pytest
import torch
import tests.base.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.core import memory
from pytorch_lightning.trainer.distrib_parts import parse_gpu_ids, determine_root_gpu_device
from pytorch_light... | 36.105802 | 106 | 0.697514 | import os
import pytest
import torch
import tests.base.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.core import memory
from pytorch_lightning.trainer.distrib_parts import parse_gpu_ids, determine_root_gpu_device
from pytorch_light... | true | true |
f75b0aaeb60a096f1dda34cbc45da2c85d2ca68e | 701 | py | Python | .github/helper/semgrep_rules/ux.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | .github/helper/semgrep_rules/ux.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | .github/helper/semgrep_rules/ux.py | sowrisurya/vmraid | f833e00978019dad87af80b41279c0146c063ed5 | [
"MIT"
] | null | null | null | import vmraid
from vmraid import msgprint, throw, _
# ruleid: vmraid-missing-translate-function
throw("Error Occured")
# ruleid: vmraid-missing-translate-function
vmraid.throw("Error Occured")
# ruleid: vmraid-missing-translate-function
vmraid.msgprint("Useful message")
# ruleid: vmraid-missing-translate-function
... | 21.90625 | 43 | 0.78602 | import vmraid
from vmraid import msgprint, throw, _
throw("Error Occured")
vmraid.throw("Error Occured")
vmraid.msgprint("Useful message")
msgprint("Useful message")
translatedmessage = _("Hello")
throw(translatedmessage)
msgprint(translatedmessage)
msgprint(_("Helpful message"))
vmraid.throw(_("Error occure... | true | true |
f75b0db440ce62afa104617f1e2415fd0ec5f945 | 6,966 | py | Python | tests/test_generate_files.py | ramiroluz/cookiecutter | 1095b60612b7f6f2c2d36610587632367cc26b3f | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate_files.py | ramiroluz/cookiecutter | 1095b60612b7f6f2c2d36610587632367cc26b3f | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate_files.py | ramiroluz/cookiecutter | 1095b60612b7f6f2c2d36610587632367cc26b3f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Tests formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
TestGenerateFiles.test_generate_files_with_trailing_newli... | 32.4 | 78 | 0.70557 |
from __future__ import unicode_literals
import os
import io
import pytest
from cookiecutter import generate
from cookiecutter import exceptions
from cookiecutter import utils
@pytest.mark.parametrize('invalid_dirname', ['', '{foo}', '{{foo', 'bar}}'])
def test_ensure_dir_is_templated_raises(invalid_dirname):
w... | true | true |
f75b0db48e895d935054620fe97f771a86175f2c | 1,968 | py | Python | tests/test_core.py | gtca/mofax | 34196d96174d3226006f2a2b727f1084e977363b | [
"MIT"
] | 3 | 2020-02-13T11:05:09.000Z | 2020-02-18T12:00:31.000Z | tests/test_core.py | gtca/mofax | 34196d96174d3226006f2a2b727f1084e977363b | [
"MIT"
] | 3 | 2021-07-06T20:21:40.000Z | 2021-12-14T01:21:10.000Z | tests/test_core.py | bioFAM/mofax | 13a38f48c739eeb182773560f37b340fd86f7e71 | [
"MIT"
] | 3 | 2021-05-20T14:29:57.000Z | 2021-12-13T13:08:29.000Z | import os
import unittest
import pandas as pd
import mofax
from mofax.plot import *
TEST_MODEL = os.path.join(os.path.dirname(__file__), "mofa2_test_model.hdf5")
class TestMofaModelConnection(unittest.TestCase):
def test_connection(self):
self.assertIsInstance(mofax.mofa_model(TEST_MODEL), mofax.mofa_m... | 26.24 | 87 | 0.684451 | import os
import unittest
import pandas as pd
import mofax
from mofax.plot import *
TEST_MODEL = os.path.join(os.path.dirname(__file__), "mofa2_test_model.hdf5")
class TestMofaModelConnection(unittest.TestCase):
def test_connection(self):
self.assertIsInstance(mofax.mofa_model(TEST_MODEL), mofax.mofa_m... | true | true |
f75b0f56e3d38f411144845899ed386194a8fadc | 27,195 | py | Python | main_imagenet.py | VITA-Group/Peek-a-Boo | 9290d4e5e3aee0dff994e1a664ec91bd6ec93176 | [
"MIT"
] | 2 | 2022-01-22T03:57:21.000Z | 2022-01-30T20:44:32.000Z | main_imagenet.py | VITA-Group/Peek-a-Boo | 9290d4e5e3aee0dff994e1a664ec91bd6ec93176 | [
"MIT"
] | null | null | null | main_imagenet.py | VITA-Group/Peek-a-Boo | 9290d4e5e3aee0dff994e1a664ec91bd6ec93176 | [
"MIT"
] | 2 | 2022-01-30T12:26:56.000Z | 2022-03-14T12:42:06.000Z | import argparse
import os
import random
import shutil
import time
import warnings
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.multiprocessing as mp
import torch.utils.data
import torch.utils.data.distr... | 43.933764 | 128 | 0.618128 | import argparse
import os
import random
import shutil
import time
import warnings
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.multiprocessing as mp
import torch.utils.data
import torch.utils.data.distr... | true | true |
f75b10a2c7a879fbd651338b85ef228c390a7489 | 2,513 | py | Python | leavesdb/.ipynb_checkpoints/utils-checkpoint.py | JacobARose/project-fossils | a0fe21a29d21bb7a1fdb969d819ce4d4243ae8cd | [
"MIT"
] | null | null | null | leavesdb/.ipynb_checkpoints/utils-checkpoint.py | JacobARose/project-fossils | a0fe21a29d21bb7a1fdb969d819ce4d4243ae8cd | [
"MIT"
] | 2 | 2019-11-20T21:09:07.000Z | 2019-11-20T21:13:42.000Z | leavesdb/.ipynb_checkpoints/utils-checkpoint.py | JacobARose/project-fossils | a0fe21a29d21bb7a1fdb969d819ce4d4243ae8cd | [
"MIT"
] | null | null | null | import os
import dataset
from stuf import stuf
'''HELPER FUNCTIONS'''
def init_local_db(local_db = os.path.expanduser(r'~/scripts/leavesdb.db'), src_db = r'/media/data_cifs/irodri15/data/db/leavesdb.db'):
'''
Whenever working on a new machine, run this function in order to make sure the main leavesdb.db file is sto... | 38.661538 | 155 | 0.683645 | import os
import dataset
from stuf import stuf
def init_local_db(local_db = os.path.expanduser(r'~/scripts/leavesdb.db'), src_db = r'/media/data_cifs/irodri15/data/db/leavesdb.db'):
if not os.path.isfile(local_db):
print(f'Copying sql db file from {src_db} to {local_db}')
shutil.copyfile(src_db, local_db)
prin... | true | true |
f75b1219b9cc4fad007c13038d7018f281b16ae9 | 256 | py | Python | strings/count.py | zelr0x/solutions | b39867ff1cfe41850bd519a3a13e1966671ab27c | [
"MIT",
"Unlicense"
] | null | null | null | strings/count.py | zelr0x/solutions | b39867ff1cfe41850bd519a3a13e1966671ab27c | [
"MIT",
"Unlicense"
] | null | null | null | strings/count.py | zelr0x/solutions | b39867ff1cfe41850bd519a3a13e1966671ab27c | [
"MIT",
"Unlicense"
] | null | null | null | # Count substring sub in string s. Case-sensitive by design.
def count_substring(s: str, sub: str) -> int:
le = len(s)
suble = len(sub)
return (sum(1 for i in range(le - suble + 1) if s[i : i + suble] == sub)
if le >= suble else 0)
| 36.571429 | 76 | 0.589844 | def count_substring(s: str, sub: str) -> int:
le = len(s)
suble = len(sub)
return (sum(1 for i in range(le - suble + 1) if s[i : i + suble] == sub)
if le >= suble else 0)
| true | true |
f75b12e45e9d4c740fcfeda2752cb33f9e570b51 | 2,170 | py | Python | tests/unit/test_hub.py | rameshwara/jina | 1d07c062c7936df8a3e298b23c0389091bae7c44 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_hub.py | rameshwara/jina | 1d07c062c7936df8a3e298b23c0389091bae7c44 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_hub.py | rameshwara/jina | 1d07c062c7936df8a3e298b23c0389091bae7c44 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from jina.helper import yaml
from jina.docker.hubio import HubIO
from jina.main.parser import set_hub_build_parser, set_hub_pushpull_parser, set_hub_new_parser
cur_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.mark.timeout(360)
def test_hub_build_pull():
args = set_hub_build_p... | 39.454545 | 115 | 0.680645 | import os
import pytest
from jina.helper import yaml
from jina.docker.hubio import HubIO
from jina.main.parser import set_hub_build_parser, set_hub_pushpull_parser, set_hub_new_parser
cur_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.mark.timeout(360)
def test_hub_build_pull():
args = set_hub_build_p... | true | true |
f75b131cd64670d4cd0fe60d1147c1db595f2404 | 113,663 | py | Python | ocs_ci/utility/utils.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | null | null | null | ocs_ci/utility/utils.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | null | null | null | ocs_ci/utility/utils.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | null | null | null | from functools import reduce
import io
import json
import logging
import os
import platform
import random
import re
import shlex
import smtplib
import string
import subprocess
import time
import traceback
import stat
from copy import deepcopy
from email.mime.multipart import MIMEMultipart
from email.mime.text import MI... | 32.643021 | 110 | 0.631094 | from functools import reduce
import io
import json
import logging
import os
import platform
import random
import re
import shlex
import smtplib
import string
import subprocess
import time
import traceback
import stat
from copy import deepcopy
from email.mime.multipart import MIMEMultipart
from email.mime.text import MI... | true | true |
f75b13bda911583db93391477bbea29eaf936b22 | 4,582 | py | Python | api_v1/namespaces/ai.py | dcronqvist/restberry-api | 35a2698ae946fc392e5e7d56dbc22b0719d6f5b6 | [
"MIT"
] | 1 | 2020-09-18T23:17:27.000Z | 2020-09-18T23:17:27.000Z | api_v1/namespaces/ai.py | dcronqvist/restberry-api | 35a2698ae946fc392e5e7d56dbc22b0719d6f5b6 | [
"MIT"
] | 7 | 2020-09-29T14:21:24.000Z | 2021-06-15T22:04:47.000Z | api_v1/namespaces/ai.py | dcronqvist/restberry-api | 35a2698ae946fc392e5e7d56dbc22b0719d6f5b6 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import request
from flask_restx import Resource, Namespace, fields, reqparse
from api_v1 import privilege_required
import pandas as pd
import pickle
from db import coll_accounts
api = Namespace("ai", path="/ai", description="Endpoints utilizing some of my trained scikit models.... | 29.371795 | 186 | 0.567438 | from datetime import datetime
from flask import request
from flask_restx import Resource, Namespace, fields, reqparse
from api_v1 import privilege_required
import pandas as pd
import pickle
from db import coll_accounts
api = Namespace("ai", path="/ai", description="Endpoints utilizing some of my trained scikit models.... | true | true |
f75b13fc8185f294887d298ba88961f4970c26a0 | 12,497 | py | Python | sphinx/cmd/build.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | 8 | 2021-01-29T23:28:16.000Z | 2021-06-04T07:12:32.000Z | sphinx/cmd/build.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | null | null | null | sphinx/cmd/build.py | ravwojdyla/sphinx | a7e10c1d36007650b5e3948021d4aa90d78127d4 | [
"BSD-2-Clause"
] | 2 | 2019-11-03T19:02:59.000Z | 2021-03-05T12:10:47.000Z | """
sphinx.cmd.build
~~~~~~~~~~~~~~~~
Build documentation from a provided source.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import argparse
import bdb
import locale
import multiprocessing
import os
import pdb
import sys
import tra... | 41.795987 | 112 | 0.603585 |
import argparse
import bdb
import locale
import multiprocessing
import os
import pdb
import sys
import traceback
from typing import IO, Any, List
from docutils.utils import SystemMessage
import sphinx.locale
from sphinx import __display_version__, package_dir
from sphinx.application import Sphinx
from sphinx.errors ... | true | true |
f75b14025ac45a499fd746922913c5e1a6d7f14d | 145 | py | Python | Exercises/python/Cod3/cod3.py | Rick222555000/Princess | 29c4c22351eeb8f2124ffe63632351fa373668e8 | [
"MIT"
] | null | null | null | Exercises/python/Cod3/cod3.py | Rick222555000/Princess | 29c4c22351eeb8f2124ffe63632351fa373668e8 | [
"MIT"
] | null | null | null | Exercises/python/Cod3/cod3.py | Rick222555000/Princess | 29c4c22351eeb8f2124ffe63632351fa373668e8 | [
"MIT"
] | null | null | null | #3- Crie um função em Python para calcular a equação "2*a + b"
def Equacao(a, b):
A, B = int(a), int(b)
return 2*A + B
print(Equacao(1, 2)) | 20.714286 | 62 | 0.613793 |
def Equacao(a, b):
A, B = int(a), int(b)
return 2*A + B
print(Equacao(1, 2)) | true | true |
f75b143525117e8f8d751bbc3e95738089337b00 | 13,862 | py | Python | deepimpute/multinet.py | mestagtx/deepimpute | a6bb01f6d000d265557f7e681b10b9eaac458fdd | [
"MIT"
] | null | null | null | deepimpute/multinet.py | mestagtx/deepimpute | a6bb01f6d000d265557f7e681b10b9eaac458fdd | [
"MIT"
] | null | null | null | deepimpute/multinet.py | mestagtx/deepimpute | a6bb01f6d000d265557f7e681b10b9eaac458fdd | [
"MIT"
] | null | null | null | import os
import warnings
import tempfile
import pandas as pd
import numpy as np
from scipy.stats import pearsonr
import tensorflow.keras as keras
from keras import backend as K
from keras.models import Model,model_from_json
from keras.layers import Dense,Dropout,Input
from keras.callbacks import EarlyStopping
import... | 36.478947 | 138 | 0.575747 | import os
import warnings
import tempfile
import pandas as pd
import numpy as np
from scipy.stats import pearsonr
import tensorflow.keras as keras
from keras import backend as K
from keras.models import Model,model_from_json
from keras.layers import Dense,Dropout,Input
from keras.callbacks import EarlyStopping
import... | true | true |
f75b14440abc0c270775f0d13ff9a23aff775308 | 4,327 | py | Python | peacemakr/generated/api/phone_home_api.py | peacemakr-io/peacemakr-python-sdk | 180bbc2e480ea855dddf0e28c2f27e83a17bfb84 | [
"Apache-2.0"
] | 3 | 2020-01-27T10:07:29.000Z | 2021-05-17T16:45:59.000Z | peacemakr/generated/api/phone_home_api.py | peacemakr-io/peacemakr-python-sdk | 180bbc2e480ea855dddf0e28c2f27e83a17bfb84 | [
"Apache-2.0"
] | 7 | 2020-06-24T03:55:36.000Z | 2021-03-30T00:43:51.000Z | peacemakr/generated/api/phone_home_api.py | peacemakr-io/peacemakr-python-sdk | 180bbc2e480ea855dddf0e28c2f27e83a17bfb84 | [
"Apache-2.0"
] | 1 | 2021-04-27T04:12:30.000Z | 2021-04-27T04:12:30.000Z | # coding: utf-8
"""
Peacemakr
This API describes the Peacemakr services, which enable seamless application layer encryption and verification. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
i... | 33.284615 | 129 | 0.608505 |
from __future__ import absolute_import
import re
import six
from peacemakr.generated.api_client import ApiClient
class PhoneHomeApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def log_post(self,... | true | true |
f75b1467c5e7f9e9ce2a2a93d28281440d57003d | 569 | py | Python | github-repo-search.py | Akash20x/Text-Analysis-Scripts | 42ba00e4d1a9dcce63adffb38726210a812076ac | [
"MIT"
] | null | null | null | github-repo-search.py | Akash20x/Text-Analysis-Scripts | 42ba00e4d1a9dcce63adffb38726210a812076ac | [
"MIT"
] | null | null | null | github-repo-search.py | Akash20x/Text-Analysis-Scripts | 42ba00e4d1a9dcce63adffb38726210a812076ac | [
"MIT"
] | null | null | null |
import requests
import json
from bs4 import BeautifulSoup
query="python"
res = requests.get(f'https://github.com/search?o=desc&q={query}&s=updated&type=Repositories')
soup = BeautifulSoup(res.text, 'html.parser')
start = soup.find_all('ul',class_='repo-list')
github=[]
for item in start:
repo = item.find_all('d... | 19.62069 | 93 | 0.666081 |
import requests
import json
from bs4 import BeautifulSoup
query="python"
res = requests.get(f'https://github.com/search?o=desc&q={query}&s=updated&type=Repositories')
soup = BeautifulSoup(res.text, 'html.parser')
start = soup.find_all('ul',class_='repo-list')
github=[]
for item in start:
repo = item.find_all('d... | true | true |
f75b1555abc4e620d68cccd71aae1d107f77ee02 | 9,400 | py | Python | lib/django-1.2/django/db/models/query_utils.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.2/django/db/models/query_utils.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.2/django/db/models/query_utils.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | """
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
import weakref
from django.utils.copycompat import deepcopy
from django.u... | 33.691756 | 81 | 0.632234 |
import weakref
from django.utils.copycompat import deepcopy
from django.utils import tree
from django.utils.datastructures import SortedDict
class CyclicDependency(Exception):
pass
class InvalidQuery(Exception):
pass
class CollectedObjects(object):
def __init__(self, previously_seen=None):
s... | true | true |
f75b15ad701ffb566bea542cf9d8e68caaed6d58 | 2,026 | py | Python | ducktape/cluster/localhost.py | stan-confluent/ducktape | e32c4347b3b538d2daa8551d13a67afd53b05ee1 | [
"Apache-2.0"
] | 2 | 2020-08-31T18:22:10.000Z | 2021-11-21T17:07:46.000Z | ducktape/cluster/localhost.py | stan-confluent/ducktape | e32c4347b3b538d2daa8551d13a67afd53b05ee1 | [
"Apache-2.0"
] | null | null | null | ducktape/cluster/localhost.py | stan-confluent/ducktape | e32c4347b3b538d2daa8551d13a67afd53b05ee1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 38.961538 | 104 | 0.742349 |
from ducktape.cluster.cluster_spec import ClusterSpec
from ducktape.cluster.node_container import NodeContainer
from .cluster import Cluster, ClusterNode
from .linux_remoteaccount import LinuxRemoteAccount
from .remoteaccount import RemoteAccountSSHConfig
class LocalhostCluster(Cluster):
def __init__(self, *arg... | true | true |
f75b15fbe108b67d682b6bb02dd0bf95da4c72c8 | 4,364 | py | Python | contrib/devtools/logprint-scanner.py | blaize-tech/bitwin24-node | e59d4ae3d26a74d1db3cf7317e48fad11215a409 | [
"MIT"
] | 5 | 2019-11-06T09:26:44.000Z | 2021-02-17T07:18:10.000Z | contrib/devtools/logprint-scanner.py | blaize-tech/bitwin24-node | e59d4ae3d26a74d1db3cf7317e48fad11215a409 | [
"MIT"
] | null | null | null | contrib/devtools/logprint-scanner.py | blaize-tech/bitwin24-node | e59d4ae3d26a74d1db3cf7317e48fad11215a409 | [
"MIT"
] | 4 | 2020-02-12T09:21:04.000Z | 2021-08-06T05:50:27.000Z | #!/usr/bin/env python
# Copyright (c) 2017-2018 The PIVX developers
# Copyright (c) 2018-present The BITWIN24 developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import os, sys
from subprocess import check_output
def count... | 41.961538 | 167 | 0.567369 |
import os, sys
from subprocess import check_output
def countRelevantCommas(line):
openParensPosStack = []
openParensPos = 0
charCounter = 0
numRelevantCommas = 0
firstOpenParensIndex = line.find("(")
for char in line:
if char == '(':
openParensPosStack.append(charCounter)
... | false | true |
f75b1604893f47d7fc3049f6b25107fd72c5e915 | 2,944 | py | Python | Code/queue_test.py | kmurata798/CS-1.3-Core-Data-Structures | ed13ede6d251136d203d54ac4878bd2f723caa95 | [
"MIT"
] | null | null | null | Code/queue_test.py | kmurata798/CS-1.3-Core-Data-Structures | ed13ede6d251136d203d54ac4878bd2f723caa95 | [
"MIT"
] | 6 | 2020-02-14T08:33:37.000Z | 2020-03-30T04:23:27.000Z | Code/queue_test.py | kmurata798/CS-1.3-Core-Data-Structures | ed13ede6d251136d203d54ac4878bd2f723caa95 | [
"MIT"
] | null | null | null | #!python
from queue import Queue
import unittest
class QueueTest(unittest.TestCase):
def test_init(self):
q = Queue()
assert q.front() is None
assert q.length() == 0
assert q.is_empty() is True
def test_init_with_list(self):
q = Queue(['A', 'B', 'C'])
assert ... | 25.6 | 43 | 0.481318 |
from queue import Queue
import unittest
class QueueTest(unittest.TestCase):
def test_init(self):
q = Queue()
assert q.front() is None
assert q.length() == 0
assert q.is_empty() is True
def test_init_with_list(self):
q = Queue(['A', 'B', 'C'])
assert q.front()... | true | true |
f75b16509d40d697de5a349cf261b0eceb4a4e87 | 5,462 | py | Python | sentence_transformers/models/Pooling.py | searchsolved/sentence-transformers-master | 50f345322d602ebab9e6d2b5e2a98e7e9d0cf9a3 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/models/Pooling.py | searchsolved/sentence-transformers-master | 50f345322d602ebab9e6d2b5e2a98e7e9d0cf9a3 | [
"Apache-2.0"
] | null | null | null | sentence_transformers/models/Pooling.py | searchsolved/sentence-transformers-master | 50f345322d602ebab9e6d2b5e2a98e7e9d0cf9a3 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import Tensor
from torch import nn
from typing import Union, Tuple, List, Iterable, Dict
import os
import json
class Pooling(nn.Module):
"""Performs pooling (max or mean) on the token embeddings.
Using pooling, it generates from a variable sized sentence a fixed sized sentence embeddi... | 45.140496 | 198 | 0.685829 | import torch
from torch import Tensor
from torch import nn
from typing import Union, Tuple, List, Iterable, Dict
import os
import json
class Pooling(nn.Module):
def __init__(self,
word_embedding_dimension: int,
pooling_mode: str = None,
pooling_mode_cls_token: bo... | true | true |
f75b184d89e9c8cfb628097b7ab2467cb8952538 | 1,858 | py | Python | 190.reverse-bits.py | Lonitch/hackerRank | 84991b8340e725422bc47eec664532cc84a3447e | [
"MIT"
] | null | null | null | 190.reverse-bits.py | Lonitch/hackerRank | 84991b8340e725422bc47eec664532cc84a3447e | [
"MIT"
] | null | null | null | 190.reverse-bits.py | Lonitch/hackerRank | 84991b8340e725422bc47eec664532cc84a3447e | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=190 lang=python3
#
# [190] Reverse Bits
#
# https://leetcode.com/problems/reverse-bits/description/
#
# algorithms
# Easy (33.67%)
# Likes: 707
# Dislikes: 250
# Total Accepted: 209.8K
# Total Submissions: 619.6K
# Testcase Example: '00000010100101000001111010011100'
#
# Reverse bits of a... | 26.169014 | 78 | 0.734123 | # notation. Therefore, in Example 2 above the input represents the signed
# integer -3 and the output represents the signed integer -1073741825.
#
#
#
#
# Follow up:
#
# If this function is called many times, how would you optimize it?
#
#
# @lc code=start
class Solution:
def reverseBits(self, n: int) -> int... | true | true |
f75b18fb1db2706484152ac79d736585a7cb47f7 | 19,660 | py | Python | manila/share/drivers/tegile/tegile.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/share/drivers/tegile/tegile.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/share/drivers/tegile/tegile.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 by Tegile Systems, 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
#
# Unle... | 38.174757 | 79 | 0.532299 |
import json
import requests
import six
from oslo_config import cfg
from oslo_log import log
from manila import utils
from manila.i18n import _, _LI, _LW
from manila import exception
from manila.share import driver
from manila.share import utils as share_utils
tegile_opts = [
cfg.StrOpt('tegile_nas_server',
... | true | true |
f75b1b6383aae8e27506efef3732f7cfdd1b7c8d | 17,752 | py | Python | statsmodels/stats/tests/test_multi.py | JanSchulz/statsmodels | a160bbc790ef447ec365651ad01da3cf11e75f7f | [
"BSD-3-Clause"
] | null | null | null | statsmodels/stats/tests/test_multi.py | JanSchulz/statsmodels | a160bbc790ef447ec365651ad01da3cf11e75f7f | [
"BSD-3-Clause"
] | null | null | null | statsmodels/stats/tests/test_multi.py | JanSchulz/statsmodels | a160bbc790ef447ec365651ad01da3cf11e75f7f | [
"BSD-3-Clause"
] | null | null | null | '''Tests for multipletests and fdr pvalue corrections
Author : Josef Perktold
['b', 's', 'sh', 'hs', 'h', 'fdr_i', 'fdr_n', 'fdr_tsbh']
are tested against R:multtest
'hommel' is tested against R stats p_adjust (not available in multtest
'fdr_gbs', 'fdr_2sbky' I did not find them in R, currently tested for
cons... | 53.46988 | 88 | 0.625113 |
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal, assert_
from statsmodels.stats.multitest import (multipletests, fdrcorrection,
fdrcorrection_twostage)
from statsmodels.stats.multicomp import tukeyhsd
pval0 = np.array([0.838541367553 , 0.6421939... | true | true |
f75b1bf0e736bbe54f281de78cf43d63ce17df0a | 189 | py | Python | python/testData/refactoring/inlineFunction/specialMethod.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/inlineFunction/specialMethod.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/testData/refactoring/inlineFunction/specialMethod.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class Additive:
def __init__(self, value):
self.value = value
def __add__(self, other):
return Additive(self.value + other.value)
Additive(1) +<caret> Additive(1) | 21 | 49 | 0.645503 | class Additive:
def __init__(self, value):
self.value = value
def __add__(self, other):
return Additive(self.value + other.value)
Additive(1) +<caret> Additive(1) | false | true |
f75b1c2929843dd67d6719fe533c7787656ae98e | 1,058 | py | Python | ddtrace/ext/aws.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | ddtrace/ext/aws.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | ddtrace/ext/aws.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | BLACKLIST_ENDPOINT = ["kms", "sts"]
def is_blacklist(endpoint_name):
"""Protecting the args sent to kms, sts to avoid security leaks
if kms disabled test_kms_client in test/contrib/botocore will fail
if sts disabled test_sts_client in test/contrib/boto contrib will fail
"""
return endpoint_name i... | 32.060606 | 78 | 0.688091 | BLACKLIST_ENDPOINT = ["kms", "sts"]
def is_blacklist(endpoint_name):
return endpoint_name in BLACKLIST_ENDPOINT
def unpacking_args(args, args_name, traced_args_list):
index = 0
response = []
for arg in args:
if arg and args_name[index] in traced_args_list:
response += [(args_name... | true | true |
f75b1c4722b2f55951a722baa7b1b1eded57420a | 551 | py | Python | 2018/day02.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | 6 | 2021-12-05T11:21:17.000Z | 2021-12-07T03:04:24.000Z | 2018/day02.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | null | null | null | 2018/day02.py | tcbegley/advent-of-code | e293d06e9cd994b26c0d10619672a6d8d2d65377 | [
"MIT"
] | null | null | null | import sys
from collections import defaultdict
def letter_counts(code):
counts = defaultdict(lambda: 0)
for c in code:
counts[c] += 1
return dict(counts)
def answer(path):
with open(path) as f:
codes = f.read().strip().split("\n")
n2, n3 = 0, 0
for code in codes:
cou... | 19 | 44 | 0.557169 | import sys
from collections import defaultdict
def letter_counts(code):
counts = defaultdict(lambda: 0)
for c in code:
counts[c] += 1
return dict(counts)
def answer(path):
with open(path) as f:
codes = f.read().strip().split("\n")
n2, n3 = 0, 0
for code in codes:
cou... | true | true |
f75b1c634a63fdec226b890a77ee7a364f412a49 | 3,210 | py | Python | customer_rewards/hooks.py | fadilsiddique/customer_rewards | 4baf6d49a5b676ae74474e100fee45f0d563f6b7 | [
"MIT"
] | null | null | null | customer_rewards/hooks.py | fadilsiddique/customer_rewards | 4baf6d49a5b676ae74474e100fee45f0d563f6b7 | [
"MIT"
] | null | null | null | customer_rewards/hooks.py | fadilsiddique/customer_rewards | 4baf6d49a5b676ae74474e100fee45f0d563f6b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "customer_rewards"
app_title = "Customer Rewards"
app_publisher = "Tridz"
app_description = "Customer referrals"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "example@tridz.... | 24.692308 | 84 | 0.692212 | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "customer_rewards"
app_title = "Customer Rewards"
app_publisher = "Tridz"
app_description = "Customer referrals"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "example@tridz.com"
app_license = "MIT"... | true | true |
f75b1c9761ca2d8c1ab12472625f8550562c42bf | 87,315 | py | Python | lazy/io/cachez/core_v1.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | 2 | 2021-12-02T00:13:16.000Z | 2022-02-26T11:18:33.000Z | lazy/io/cachez/core_v1.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | null | null | null | lazy/io/cachez/core_v1.py | trisongz/lazycls | 701bad1a358ed3bb136347d0c5eb81de3201f6a3 | [
"MIT"
] | null | null | null |
"""
Source: https://github.com/grantjenks/python-diskcache/blob/71db7753610bcd4bd7adda28abeb2b0fdebbc31f/diskcache/core.py
Deprecated in favor of v2
"""
import sys
import codecs
import contextlib as cl
import errno
import functools as ft
import inspect
import io
import json
import os
import os.path as op
import pick... | 36.457203 | 169 | 0.55388 |
import sys
import codecs
import contextlib as cl
import errno
import functools as ft
import inspect
import io
import json
import os
import os.path as op
import pickletools
import sqlite3
import struct
import tempfile
import threading
import time
import warnings
import zlib
import dill
from .static_v1 import *
from ty... | true | true |
f75b1d7ee9162f250d67a9c8a2ca268531d378ae | 12,173 | py | Python | zfit/core/loss.py | olantwin/zfit | dae89fd95fc2158c0e7530664d8ca999db4802c5 | [
"BSD-3-Clause"
] | null | null | null | zfit/core/loss.py | olantwin/zfit | dae89fd95fc2158c0e7530664d8ca999db4802c5 | [
"BSD-3-Clause"
] | null | null | null | zfit/core/loss.py | olantwin/zfit | dae89fd95fc2158c0e7530664d8ca999db4802c5 | [
"BSD-3-Clause"
] | null | null | null | import abc
from collections import OrderedDict
import tensorflow as tf
from typing import Optional, Union, List
from zfit import ztf
from zfit.util import ztyping
from zfit.util.cache import Cachable
from zfit.util.graph import get_dependents_auto
from .baseobject import BaseObject, BaseDependentsMixin
from .interfac... | 38.400631 | 119 | 0.637969 | import abc
from collections import OrderedDict
import tensorflow as tf
from typing import Optional, Union, List
from zfit import ztf
from zfit.util import ztyping
from zfit.util.cache import Cachable
from zfit.util.graph import get_dependents_auto
from .baseobject import BaseObject, BaseDependentsMixin
from .interfac... | true | true |
f75b1e02d0b7ef113c7dd8acb3761a4fe506d37f | 8,296 | py | Python | tests/fixtures_regress/models.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | 2 | 2015-01-21T15:45:07.000Z | 2015-02-21T02:38:13.000Z | tests/fixtures_regress/models.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | null | null | null | tests/fixtures_regress/models.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | 1 | 2021-03-06T14:22:00.000Z | 2021-03-06T14:22:00.000Z | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_na... | 24.186589 | 85 | 0.695757 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Animal(models.Model):
name = models.CharField(max_length=150)
latin_na... | true | true |
f75b1e051bd96130b9c35b3fcf5553a7937d4087 | 1,755 | py | Python | filesystem.py | EduardoSaverin/password-manager | 8fac6386f31c6e13fa26131b470ba6aaf0512bcf | [
"Apache-2.0"
] | null | null | null | filesystem.py | EduardoSaverin/password-manager | 8fac6386f31c6e13fa26131b470ba6aaf0512bcf | [
"Apache-2.0"
] | null | null | null | filesystem.py | EduardoSaverin/password-manager | 8fac6386f31c6e13fa26131b470ba6aaf0512bcf | [
"Apache-2.0"
] | null | null | null | import config
import json
import os
import errno
from typing import Dict
def read_mastermac() -> str:
with open(config.MASTERMAC_FILE, 'rb') as file:
key = file.read()
return key
def write_mastermac(key: str) -> None:
with open(config.MASTERMAC_FILE, 'wb') as file:
file.write(key.encode(... | 25.071429 | 64 | 0.654131 | import config
import json
import os
import errno
from typing import Dict
def read_mastermac() -> str:
with open(config.MASTERMAC_FILE, 'rb') as file:
key = file.read()
return key
def write_mastermac(key: str) -> None:
with open(config.MASTERMAC_FILE, 'wb') as file:
file.write(key.encode(... | true | true |
f75b1ec92490e88d0d19a3c6da274eaa2f70f3a8 | 7,083 | py | Python | main.py | mblaszczykowski/Type-speed-game-with-Python-tkinter-GUI | f6750c0b47562422e65399f3ba45747da6653951 | [
"CNRI-Python",
"Xnet",
"X11"
] | null | null | null | main.py | mblaszczykowski/Type-speed-game-with-Python-tkinter-GUI | f6750c0b47562422e65399f3ba45747da6653951 | [
"CNRI-Python",
"Xnet",
"X11"
] | null | null | null | main.py | mblaszczykowski/Type-speed-game-with-Python-tkinter-GUI | f6750c0b47562422e65399f3ba45747da6653951 | [
"CNRI-Python",
"Xnet",
"X11"
] | null | null | null | from tkinter import *
import datetime
import random
import time
# done
# dac przycisk wyjdz podczas gry
slowa = ["serious","occur","media","ready","sign","thought","list","individual","simple","quality","pressure","accept","answer","hard","resource","identify","left","meeting","determine","prepare","disea... | 44.26875 | 1,970 | 0.58478 | from tkinter import *
import datetime
import random
import time
slowa = ["serious","occur","media","ready","sign","thought","list","individual","simple","quality","pressure","accept","answer","hard","resource","identify","left","meeting","determine","prepare","disease","whatever","success","argue","cup","pa... | true | true |
f75b1fe3a71f2b800d976a1cdc46d02a3641f614 | 8,289 | py | Python | lite/tests/unittest_py/op/test_scale_op.py | HuangShiqing/Paddle-Lite | 061f94e4624c7cc657ff914c0e589bf1192d73c5 | [
"Apache-2.0"
] | 1 | 2022-03-18T19:48:40.000Z | 2022-03-18T19:48:40.000Z | lite/tests/unittest_py/op/test_scale_op.py | HuangShiqing/Paddle-Lite | 061f94e4624c7cc657ff914c0e589bf1192d73c5 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/op/test_scale_op.py | HuangShiqing/Paddle-Lite | 061f94e4624c7cc657ff914c0e589bf1192d73c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 appli... | 39.660287 | 125 | 0.59971 |
import sys
sys.path.append('../')
from auto_scan_test import AutoScanTest, IgnoreReasons
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import unittest
import hypothesis
from hypothesis import given, settings, seed, example, assume
import... | true | true |
f75b1ff9551d9dc3a4d8f0bb74198e52f0809607 | 1,541 | py | Python | scrapper/urls.py | Dalakoti07/optimal-price-back-end | 059f03edf88764229efd9451433aef9602e8520f | [
"MIT",
"Unlicense"
] | null | null | null | scrapper/urls.py | Dalakoti07/optimal-price-back-end | 059f03edf88764229efd9451433aef9602e8520f | [
"MIT",
"Unlicense"
] | null | null | null | scrapper/urls.py | Dalakoti07/optimal-price-back-end | 059f03edf88764229efd9451433aef9602e8520f | [
"MIT",
"Unlicense"
] | null | null | null | from django.conf.urls import url, include
from rest_framework import routers
from scrapper import views
from .views import ReviewViewSet,ProductsViewSet,ProductDetailViewSet,ProductFullSpecViewSet,LatestMobilesViewSet,ecommerceBasedSearchViewSet,CompareMobilesViewSet,getSubCategories
router = routers.SimpleRouter()
... | 35.022727 | 180 | 0.71512 | from django.conf.urls import url, include
from rest_framework import routers
from scrapper import views
from .views import ReviewViewSet,ProductsViewSet,ProductDetailViewSet,ProductFullSpecViewSet,LatestMobilesViewSet,ecommerceBasedSearchViewSet,CompareMobilesViewSet,getSubCategories
router = routers.SimpleRouter()
... | true | true |
f75b205dbc314bae725bf9c3001fc29531dbcd1e | 875 | py | Python | examples/file_dialog.py | jni/magicgui | cb83f9fd8b525e5fffa0156e592128cb233750df | [
"MIT"
] | 1 | 2020-06-01T06:02:25.000Z | 2020-06-01T06:02:25.000Z | examples/file_dialog.py | jni/magicgui | cb83f9fd8b525e5fffa0156e592128cb233750df | [
"MIT"
] | 1 | 2020-06-29T12:06:23.000Z | 2020-07-01T03:25:17.000Z | examples/file_dialog.py | jni/magicgui | cb83f9fd8b525e5fffa0156e592128cb233750df | [
"MIT"
] | null | null | null | """FileDialog with magicgui."""
from pathlib import Path
from typing import Sequence
from magicgui import event_loop, magicgui
@magicgui(filename={"mode": "r"})
def filepicker(filename=Path("~")):
"""Take a filename and do something with it."""
print("The filename is:", filename)
return filename
# Sequ... | 29.166667 | 73 | 0.715429 | from pathlib import Path
from typing import Sequence
from magicgui import event_loop, magicgui
@magicgui(filename={"mode": "r"})
def filepicker(filename=Path("~")):
print("The filename is:", filename)
return filename
@magicgui(filenames={"label": "Choose Tiff files:", "filter": "*.tif"})
def filespicker(fi... | true | true |
f75b22291a8eed7f28a53106e894ad44457b1061 | 47,969 | py | Python | pycqed/measurement/CBox_sweep_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 60 | 2016-08-03T10:00:18.000Z | 2021-11-10T11:46:16.000Z | pycqed/measurement/CBox_sweep_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 512 | 2016-08-03T17:10:02.000Z | 2022-03-31T14:03:43.000Z | pycqed/measurement/CBox_sweep_functions.py | nuttamas/PycQED_py3 | 1ee35c7428d36ed42ba4afb5d4bda98140b2283e | [
"MIT"
] | 34 | 2016-10-19T12:00:52.000Z | 2022-03-19T04:43:26.000Z | import numpy as np
import logging
from pycqed.measurement import sweep_functions as swf
from pycqed.measurement.sweep_functions import Soft_Sweep
from pycqed.measurement.waveform_control_CC import waveform as wf
# FIXME: Commented out as there is no module named Experiments.CLEAR.prepare_for_CLEAR.prepare_for_CLEAR
# ... | 37.243012 | 126 | 0.619171 | import numpy as np
import logging
from pycqed.measurement import sweep_functions as swf
from pycqed.measurement.sweep_functions import Soft_Sweep
from pycqed.measurement.waveform_control_CC import waveform as wf
import time
import imp
gauss_width = 10
imp.reload(wf)
class CBox_Sweep(swf.Hard_Sweep):
def __init... | true | true |
f75b22b8577e7a2d1d5e418846dc6ea9d2511cd4 | 1,004 | py | Python | myCompany/rules/migrations/0002_auto_20161207_2046.py | Rom4eg/myCompany | 31846a861d8b0560191e2e1d9791f101b88874df | [
"MIT"
] | null | null | null | myCompany/rules/migrations/0002_auto_20161207_2046.py | Rom4eg/myCompany | 31846a861d8b0560191e2e1d9791f101b88874df | [
"MIT"
] | null | null | null | myCompany/rules/migrations/0002_auto_20161207_2046.py | Rom4eg/myCompany | 31846a861d8b0560191e2e1d9791f101b88874df | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-07 20:46
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('rules', '0001_initial'),
]
o... | 30.424242 | 166 | 0.62749 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('rules', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='rule... | true | true |
f75b230c232121a422c6a4f977bec56ff0e3d43d | 3,245 | py | Python | StructuralAnalysis/Section.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 6 | 2021-02-08T13:00:40.000Z | 2022-02-18T07:11:14.000Z | StructuralAnalysis/Section.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | null | null | null | StructuralAnalysis/Section.py | Hazem-Kassab/StructuralAnalysis | d7e99a42c94fed787a2bc4931d33cd1ed65f8707 | [
"MIT"
] | 1 | 2022-03-12T03:14:39.000Z | 2022-03-12T03:14:39.000Z | """
Section class is an abstract class.
Local axis of the section is as follows:
x-axis is the longitudinal axis that is directed from the start node to the end node of the element
y-axis is directed upward the section
z-axis is directed to the left
Properties(abstract methods):
properties are overridden by the inh... | 22.852113 | 99 | 0.664715 |
from math import pi
from abc import ABC, abstractmethod
class Section(ABC):
def __init__(self):
self.__area = None
self.__inertia_y = None
self.__inertia_z = None
self.__polar_inertia = None
self.__warping_rigidity = None
@property
@abstractmethod
def area(se... | true | true |
f75b23ebd01fc8d1c891cd693b7eaf83b195c9eb | 14,579 | py | Python | nilearn/decoding/tests/test_space_net.py | darya-chyzhyk/nilearn | c2a597586314ee1fe9da260d7d7ee00ef8b4eef5 | [
"BSD-2-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | nilearn/decoding/tests/test_space_net.py | darya-chyzhyk/nilearn | c2a597586314ee1fe9da260d7d7ee00ef8b4eef5 | [
"BSD-2-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | nilearn/decoding/tests/test_space_net.py | darya-chyzhyk/nilearn | c2a597586314ee1fe9da260d7d7ee00ef8b4eef5 | [
"BSD-2-Clause"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | import itertools
from functools import partial
from nose import SkipTest
from nose.tools import (assert_equal, assert_true, assert_false,
assert_raises)
import numpy as np
from sklearn.datasets import load_iris
from sklearn.utils import extmath
from sklearn.linear_model import Lasso
from sklearn... | 38.065274 | 79 | 0.614583 | import itertools
from functools import partial
from nose import SkipTest
from nose.tools import (assert_equal, assert_true, assert_false,
assert_raises)
import numpy as np
from sklearn.datasets import load_iris
from sklearn.utils import extmath
from sklearn.linear_model import Lasso
from sklearn... | true | true |
f75b2433f55dee57fef1327a9e18f1c0e210a2b1 | 1,965 | py | Python | examples/time_frequency/plot_source_power_spectrum.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 1 | 2019-12-11T05:07:08.000Z | 2019-12-11T05:07:08.000Z | examples/time_frequency/plot_source_power_spectrum.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 23 | 2017-09-12T11:08:26.000Z | 2019-10-04T11:11:29.000Z | examples/time_frequency/plot_source_power_spectrum.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | """
======================================================
Compute source power spectral density (PSD) in a label
======================================================
Returns an STC file containing the PSD (in dB) of each of the sources
within a label.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
... | 33.87931 | 79 | 0.60458 |
import matplotlib.pyplot as plt
import mne
from mne import io
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, compute_source_psd
print(__doc__)
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_raw.fif'
fname_inv = data_path + '/MEG/sample/sample_a... | true | true |
f75b244d82a262a20a70431d755c3d1416aaa695 | 10,213 | py | Python | src/oci/object_storage/models/replication_policy.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/models/replication_policy.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/object_storage/models/replication_policy.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.733974 | 245 | 0.650935 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ReplicationPolicy(object):
STATUS_ACTIVE = "ACTIVE"
STATUS_CLIENT_ERROR = "CLIENT_ERROR"
def __init... | true | true |
f75b248903402e810639829500c03403d89c1758 | 252 | py | Python | utils/change_name.py | chaonan99/project-euler | 51e1f1d13afda36da8020bebd88e514212c82a81 | [
"MIT"
] | null | null | null | utils/change_name.py | chaonan99/project-euler | 51e1f1d13afda36da8020bebd88e514212c82a81 | [
"MIT"
] | null | null | null | utils/change_name.py | chaonan99/project-euler | 51e1f1d13afda36da8020bebd88e514212c82a81 | [
"MIT"
] | null | null | null | import glob
import os
root_path = "../junior/"
for file in glob.glob(os.path.join(root_path, "problem_*")):
# print(file)
# print(file.split("problem_")[1])
os.rename(file, os.path.join(root_path, "p" + file.split("problem_")[1])) | 28 | 77 | 0.630952 | import glob
import os
root_path = "../junior/"
for file in glob.glob(os.path.join(root_path, "problem_*")):
os.rename(file, os.path.join(root_path, "p" + file.split("problem_")[1])) | true | true |
f75b25de77d43cf9ec73b1ad2cc91a0893b64c66 | 815 | py | Python | app.py | henrikre/restaurant_reviews | e849ddf82fcafd892e90c11fe9df71c98087d500 | [
"MIT"
] | null | null | null | app.py | henrikre/restaurant_reviews | e849ddf82fcafd892e90c11fe9df71c98087d500 | [
"MIT"
] | null | null | null | app.py | henrikre/restaurant_reviews | e849ddf82fcafd892e90c11fe9df71c98087d500 | [
"MIT"
] | null | null | null | from flask import Flask, g, jsonify
from auth import auth
import config
import models
from resources.users import users_api
from resources.restaurants import restaurants_api
from resources.reviews import reviews_api
app = Flask(__name__)
app.register_blueprint(users_api, url_prefix='/api/v1')
app.register_blueprint... | 25.46875 | 67 | 0.757055 | from flask import Flask, g, jsonify
from auth import auth
import config
import models
from resources.users import users_api
from resources.restaurants import restaurants_api
from resources.reviews import reviews_api
app = Flask(__name__)
app.register_blueprint(users_api, url_prefix='/api/v1')
app.register_blueprint... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.