hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790da02a1f4ea3a9e0f830edc861126ed46cf2b6 | 18,657 | py | Python | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/15-sender_receiver_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/15-sender_receiver_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints/scaling_ltl_timed_transition_system/15-sender_receiver_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | 38.388889 | 89 | 0.577049 | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | true | true |
790da3fb01143d681327600c538468b2c14e75f6 | 392 | py | Python | test_validate_input_file.py | cszelesbbs/servicecatalogenabler2 | f3ece5e49f047b45e796a7656816d7603877ec70 | [
"Apache-2.0"
] | null | null | null | test_validate_input_file.py | cszelesbbs/servicecatalogenabler2 | f3ece5e49f047b45e796a7656816d7603877ec70 | [
"Apache-2.0"
] | null | null | null | test_validate_input_file.py | cszelesbbs/servicecatalogenabler2 | f3ece5e49f047b45e796a7656816d7603877ec70 | [
"Apache-2.0"
] | null | null | null | import json
import yaml
from jsonschema import validate
import os
configuration_file = os.environ['SC_ENABLER_CONF']
with open(configuration_file, 'r') as conf_file:
input_config = yaml.safe_load(conf_file)
with open("./input_schema_validator.json", 'r') as schema_file:
schema = json.load(schema_file)
def ... | 23.058824 | 63 | 0.772959 | import json
import yaml
from jsonschema import validate
import os
configuration_file = os.environ['SC_ENABLER_CONF']
with open(configuration_file, 'r') as conf_file:
input_config = yaml.safe_load(conf_file)
with open("./input_schema_validator.json", 'r') as schema_file:
schema = json.load(schema_file)
def ... | true | true |
790da45c9689d6ffd0b636d581f5ce7ab96fe34b | 3,532 | py | Python | gtpython/gt/annotationsketch/image_info.py | ggonnella/genometools | 48103b35c99920179fae697086efdf6d0548a1fe | [
"BSD-2-Clause"
] | 1 | 2020-02-19T14:10:38.000Z | 2020-02-19T14:10:38.000Z | gtpython/gt/annotationsketch/image_info.py | ggonnella/genometools | 48103b35c99920179fae697086efdf6d0548a1fe | [
"BSD-2-Clause"
] | null | null | null | gtpython/gt/annotationsketch/image_info.py | ggonnella/genometools | 48103b35c99920179fae697086efdf6d0548a1fe | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 Daniel Standage <daniel.standage@gmail.com>
# Copyright (c) 2008 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
# Copyright (c) 2008 Center for Bioinformatics, University of Hamburg
#
# Permission to use, copy, modify, and distribute this software fo... | 37.178947 | 91 | 0.656569 |
from gt.dlload import gtlib
from gt.annotationsketch.rec_map import RecMap
import math
class ImageInfo:
def __init__(self):
self.ii = gtlib.gt_image_info_new()
self._as_parameter_ = self.ii
self.hotspots = None
def __del__(self):
try:
gtlib.gt_... | false | true |
790da6152f12e012efa9bdc9399809ed616980f1 | 77,846 | py | Python | pysnmp/HUAWEI-RSVPTE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/HUAWEI-RSVPTE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/HUAWEI-RSVPTE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HUAWEI-RSVPTE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-RSVPTE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:36:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 149.703846 | 12,243 | 0.770675 |
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuild... | true | true |
790da6315d54ab39b87b78c2b6aab8546c002052 | 72,148 | py | Python | chia/full_node/full_node_api.py | AppleOfEnlightenment/chia-blockchain | d3f2ae367d00cf20360c7d7a177f941ea53ecbcb | [
"Apache-2.0"
] | null | null | null | chia/full_node/full_node_api.py | AppleOfEnlightenment/chia-blockchain | d3f2ae367d00cf20360c7d7a177f941ea53ecbcb | [
"Apache-2.0"
] | null | null | null | chia/full_node/full_node_api.py | AppleOfEnlightenment/chia-blockchain | d3f2ae367d00cf20360c7d7a177f941ea53ecbcb | [
"Apache-2.0"
] | null | null | null | import asyncio
import dataclasses
import time
import traceback
from secrets import token_bytes
from typing import Dict, List, Optional, Tuple, Set
from blspy import AugSchemeMPL, G2Element
from chiabip158 import PyBIP158
import chia.server.ws_connection as ws
from chia.consensus.block_creation import create_unfinishe... | 47.811796 | 120 | 0.645049 | import asyncio
import dataclasses
import time
import traceback
from secrets import token_bytes
from typing import Dict, List, Optional, Tuple, Set
from blspy import AugSchemeMPL, G2Element
from chiabip158 import PyBIP158
import chia.server.ws_connection as ws
from chia.consensus.block_creation import create_unfinishe... | true | true |
790da6c31447b466d9cc6aace31cb537caffffd7 | 2,357 | py | Python | apps/amcm/migrations/0032_auto_20220104_0437.py | agsneutron/asociacion_mexicana_cuarto_milla | 4657e1f494eb572e9b40b2804e012cdfd6193c51 | [
"MIT"
] | null | null | null | apps/amcm/migrations/0032_auto_20220104_0437.py | agsneutron/asociacion_mexicana_cuarto_milla | 4657e1f494eb572e9b40b2804e012cdfd6193c51 | [
"MIT"
] | null | null | null | apps/amcm/migrations/0032_auto_20220104_0437.py | agsneutron/asociacion_mexicana_cuarto_milla | 4657e1f494eb572e9b40b2804e012cdfd6193c51 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2022-01-04 10:37
import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('amcm', '0031_auto_20220104_0431'),
]
operations = [
m... | 40.637931 | 159 | 0.614765 |
import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('amcm', '0031_auto_20220104_0431'),
]
operations = [
migrations.AddField(
model_name='eve... | true | true |
790da6f58ba37152bebfc637af2c6cf00f701207 | 1,715 | py | Python | gautools/__init__.py | thompcinnamon/QM-calc-scripts | 60b06e14b2efd307d419201079bb24152ab0bd3c | [
"Apache-2.0"
] | null | null | null | gautools/__init__.py | thompcinnamon/QM-calc-scripts | 60b06e14b2efd307d419201079bb24152ab0bd3c | [
"Apache-2.0"
] | 2 | 2018-07-18T19:53:08.000Z | 2019-02-25T23:25:51.000Z | gautools/__init__.py | theavey/QM-calc-scripts | 60b06e14b2efd307d419201079bb24152ab0bd3c | [
"Apache-2.0"
] | 1 | 2017-01-04T20:50:21.000Z | 2017-01-04T20:50:21.000Z | """This is a set of tools built up over time for working with Gaussian and
QChem input and output."""
########################################################################
# #
# ... | 61.25 | 74 | 0.348105 | true | true | |
790da99041289e9e42219eef39722619d6f10b57 | 3,222 | py | Python | stanCode_Projects/weather_master/weather_master.py | clairejrlin/stanCode_projects | 452a93f9db2de610d0580faecca80b3c3d311395 | [
"MIT"
] | null | null | null | stanCode_Projects/weather_master/weather_master.py | clairejrlin/stanCode_projects | 452a93f9db2de610d0580faecca80b3c3d311395 | [
"MIT"
] | null | null | null | stanCode_Projects/weather_master/weather_master.py | clairejrlin/stanCode_projects | 452a93f9db2de610d0580faecca80b3c3d311395 | [
"MIT"
] | null | null | null | """
File: weather_master.py
Name: Claire Lin
-----------------------
This program should implement a console program
that asks weather data from user to compute the
average, highest, lowest, cold days among the inputs.
Output format should match what is shown in the sample
run in the Assignment 2 Handout.
"""
EXIT = ... | 28.513274 | 103 | 0.543451 |
EXIT = -100
def main():
print('stanCode \"Weather Master 4.0\"!')
maximum = -100000000
minimum = 100000000
total = 0
count = 0
cold_day = 0
while True:
temperature = int(input('Next Temperature: (or '+str(EXIT) + ' to quit)? '))
if temperature == EXIT an... | true | true |
790da9f977709c1b0764594562bf1b2cb0f52777 | 9,682 | py | Python | tracker/tracker/user_tracker.py | PuffyPuffin/LO_user | c7cafc2045b027aad0098d034cbe2b70126c8379 | [
"MIT"
] | null | null | null | tracker/tracker/user_tracker.py | PuffyPuffin/LO_user | c7cafc2045b027aad0098d034cbe2b70126c8379 | [
"MIT"
] | null | null | null | tracker/tracker/user_tracker.py | PuffyPuffin/LO_user | c7cafc2045b027aad0098d034cbe2b70126c8379 | [
"MIT"
] | null | null | null | """
Code for particle tracking, designed for ROMS output. This new version
makes extensive use of nearest-neighbor KDTree algorithms for interpolation.
This results is significantly (36x) faster runtimes compared with old version.
PERFORMANCE: about 3 minutes per day for a 3D cas6 experiment with 10k particles.
NOTE... | 35.465201 | 97 | 0.673001 |
import sys
from datetime import datetime, timedelta
from time import time
import argparse
import numpy as np
from lo_tools import Lfun, zfun
Ldir = Lfun.Lstart()
from importlib import reload
pth = Ldir['LOu'] / 'tracker'
if str(pth) not in sys.path:
sys.path.append(str(pth))
import experiments as exp
reload(exp... | true | true |
790daa7e42b3981224910e6c988de58eb9912933 | 38,591 | py | Python | pandas/core/base.py | BryanRacic/pandas | 21c299194a2b59a715fa7264bd6b44787deafc7a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/base.py | BryanRacic/pandas | 21c299194a2b59a715fa7264bd6b44787deafc7a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/base.py | BryanRacic/pandas | 21c299194a2b59a715fa7264bd6b44787deafc7a | [
"BSD-3-Clause"
] | null | null | null | """
Base and utility classes for pandas objects.
"""
from __future__ import annotations
import textwrap
from typing import (
TYPE_CHECKING,
Any,
Generic,
Hashable,
Literal,
TypeVar,
cast,
final,
)
import numpy as np
import pandas._libs.lib as lib
from pandas._typing import (
Arra... | 30.338836 | 88 | 0.560208 |
from __future__ import annotations
import textwrap
from typing import (
TYPE_CHECKING,
Any,
Generic,
Hashable,
Literal,
TypeVar,
cast,
final,
)
import numpy as np
import pandas._libs.lib as lib
from pandas._typing import (
ArrayLike,
DtypeObj,
FrameOrSeries,
IndexLabe... | true | true |
790dabad8750b692755b533b3315b84491588b56 | 3,339 | py | Python | app/modules/core/decorators.py | Clivern/Kraven | 5d8d2de26e170d853d7d5f2b1f2d453ab07e4401 | [
"Apache-2.0"
] | 3 | 2018-07-22T22:36:09.000Z | 2019-05-31T10:29:54.000Z | app/modules/core/decorators.py | Clivern/Kraven | 5d8d2de26e170d853d7d5f2b1f2d453ab07e4401 | [
"Apache-2.0"
] | 41 | 2018-07-22T22:07:52.000Z | 2018-11-14T11:07:48.000Z | app/modules/core/decorators.py | Clivern/Kraven | 5d8d2de26e170d853d7d5f2b1f2d453ab07e4401 | [
"Apache-2.0"
] | 1 | 2020-04-24T12:55:27.000Z | 2020-04-24T12:55:27.000Z | """
Custom Decorators
"""
# Django
from django.shortcuts import redirect, reverse
from django.http import JsonResponse
from django.utils.translation import gettext as _
from django.http import Http404
# local Django
from app.modules.util.helpers import Helpers
from app.modules.core.response import Response
from app.m... | 37.943182 | 155 | 0.668763 |
from django.shortcuts import redirect, reverse
from django.http import JsonResponse
from django.utils.translation import gettext as _
from django.http import Http404
from app.modules.util.helpers import Helpers
from app.modules.core.response import Response
from app.modules.entity.option_entity import Option_Entity... | true | true |
790dacbafc49042cca1ce842ab68f6c32c98f502 | 10,765 | py | Python | sdk/python/pulumi_aws/signer/_inputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/signer/_inputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/signer/_inputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 32.820122 | 186 | 0.636693 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'SigningJobDestinationArgs',
'SigningJobDestinationS3Args',
'SigningJobRevocationRecordArgs',
'SigningJobSignedObjectArgs',
'SigningJobS... | true | true |
790dad6bf0d7a8a279a293c04eee935f54123d69 | 3,344 | py | Python | grr/client/grr_response_client/client_utils.py | billstackpole/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2019-03-28T07:09:41.000Z | 2019-03-28T07:09:41.000Z | grr/client/grr_response_client/client_utils.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | null | null | null | grr/client/grr_response_client/client_utils.py | gingogo/grr | 203a0a99990a2d4004aed84a5cd822cbda2b418c | [
"Apache-2.0"
] | 1 | 2018-08-30T14:50:24.000Z | 2018-08-30T14:50:24.000Z | #!/usr/bin/env python
"""Client utilities."""
import logging
import sys
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import client_fs as rdf_client_fs
from grr_response_core.lib.rdfvalues import paths as rdf_paths
# pylint: disable=g-import-not-at-top
if sys.platform == "win32":
fro... | 29.078261 | 79 | 0.746112 |
import logging
import sys
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import client_fs as rdf_client_fs
from grr_response_core.lib.rdfvalues import paths as rdf_paths
if sys.platform == "win32":
from grr_response_client import client_utils_windows as _client_utils
elif sys.platfo... | true | true |
790dae2213573bb04aeb653ea71d00b40d4cde44 | 4,045 | py | Python | 01-Login/webappexample/settings.py | alexisluque/auth0-django-web-app | 4c6a530fac04e2b48f2dc85cc8ef414e2b03c599 | [
"MIT"
] | null | null | null | 01-Login/webappexample/settings.py | alexisluque/auth0-django-web-app | 4c6a530fac04e2b48f2dc85cc8ef414e2b03c599 | [
"MIT"
] | 1 | 2018-07-09T14:23:54.000Z | 2018-07-09T14:23:54.000Z | 01-Login/webappexample/settings.py | alexisluque/auth0-django-web-app | 4c6a530fac04e2b48f2dc85cc8ef414e2b03c599 | [
"MIT"
] | null | null | null | """
Django settings for webappexample project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
fro... | 26.096774 | 91 | 0.710507 |
from dotenv import load_dotenv, find_dotenv
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '*dn4z%$4b6-d1+epmb=hd1m3g#$*1*%&%x+4m_8*cvakee%=7q'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'djan... | true | true |
790daea48156492a628ca355400ac2fc6d76bdbc | 2,288 | py | Python | daiquiri/oai/utils.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 14 | 2018-12-23T18:35:02.000Z | 2021-12-15T04:55:12.000Z | daiquiri/oai/utils.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 40 | 2018-12-20T12:44:05.000Z | 2022-03-21T11:35:20.000Z | daiquiri/oai/utils.py | agy-why/daiquiri | 4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d | [
"Apache-2.0"
] | 5 | 2019-05-16T08:03:35.000Z | 2021-08-23T20:03:11.000Z | import logging
from django.conf import settings
from daiquiri.core.utils import import_class
from .adapter import OaiAdapter
from .models import Record
logger = logging.getLogger(__name__)
def get_metadata_format(metadata_prefix):
return next(metadata_format for metadata_format in settings.OAI_METADATA_FORMAT... | 33.15942 | 106 | 0.697115 | import logging
from django.conf import settings
from daiquiri.core.utils import import_class
from .adapter import OaiAdapter
from .models import Record
logger = logging.getLogger(__name__)
def get_metadata_format(metadata_prefix):
return next(metadata_format for metadata_format in settings.OAI_METADATA_FORMAT... | true | true |
790dafb3cd44c4622f4bde96ce06a13b96b35e6e | 2,003 | py | Python | classifier/src/model_lgb.py | banboooo044/natural-language-sentiment-anaysis | e18d7c0373d9f0a00d5a3cc14abf671081bc940b | [
"DOC"
] | null | null | null | classifier/src/model_lgb.py | banboooo044/natural-language-sentiment-anaysis | e18d7c0373d9f0a00d5a3cc14abf671081bc940b | [
"DOC"
] | null | null | null | classifier/src/model_lgb.py | banboooo044/natural-language-sentiment-anaysis | e18d7c0373d9f0a00d5a3cc14abf671081bc940b | [
"DOC"
] | null | null | null | import os,sys
sys.path.append('../')
import os
import numpy as np
import pandas as pd
import lightgbm as lgb
from src.model import Model
from src.util import Util
from sklearn.metrics import log_loss, accuracy_score, f1_score, classification_report
class ModelLGB(Model):
def __init__(self, run_fold_name, **par... | 36.418182 | 93 | 0.64653 | import os,sys
sys.path.append('../')
import os
import numpy as np
import pandas as pd
import lightgbm as lgb
from src.model import Model
from src.util import Util
from sklearn.metrics import log_loss, accuracy_score, f1_score, classification_report
class ModelLGB(Model):
def __init__(self, run_fold_name, **par... | true | true |
790db0a494b66f67346f0144d8df455628407ad8 | 9,231 | py | Python | airflow/sensors/base_sensor_operator.py | joshowen/airflow | d0cf232919839d0e338dcc38a5c7a1841077eaae | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | airflow/sensors/base_sensor_operator.py | joshowen/airflow | d0cf232919839d0e338dcc38a5c7a1841077eaae | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/sensors/base_sensor_operator.py | santecapital/airflow | 7f02e56c9cb8b548624d13e9c2c2b89d753f996b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2020-07-17T14:02:28.000Z | 2022-02-23T04:29:58.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.769231 | 96 | 0.638609 |
import hashlib
import os
from datetime import timedelta
from time import sleep
from typing import Any, Dict, Iterable
from airflow.exceptions import (
AirflowException, AirflowRescheduleException, AirflowSensorTimeout, AirflowSkipException,
)
from airflow.models import BaseOperator, SkipMixin, Ta... | true | true |
790db0fe89a04beb0224baffd456de9a966428fd | 12,782 | py | Python | topi/python/topi/cuda/conv2d_nhwc_tensorcore.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 9 | 2019-12-17T08:03:54.000Z | 2022-01-19T02:34:23.000Z | topi/python/topi/cuda/conv2d_nhwc_tensorcore.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 2 | 2020-07-08T12:34:59.000Z | 2020-07-11T15:54:47.000Z | topi/python/topi/cuda/conv2d_nhwc_tensorcore.py | retamia/tvm | 5d25dc54d874bf2ddf0e8cf34c4748e9e2656fd8 | [
"Apache-2.0"
] | 3 | 2020-10-04T20:30:18.000Z | 2022-01-24T18:03:52.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.068966 | 94 | 0.643561 |
import numpy as np
import tvm
from tvm import te
from tvm import autotvm
from ..util import get_const_tuple, traverse_inline, simplify
from ..nn.pad import pad
from ..nn.util import get_pad_tuple
from .tensor_intrin import intrin_wmma_load_matrix_A
from .tensor_intrin import intrin_wmma_load_matrix_W
... | true | true |
790db224486fee9e2e6acac2ef44531a3d016a9c | 44,167 | py | Python | shell/control.py | dromero1452/shellsploit-framework | 38ce78542fd2dd2ac30f6567972d695ede1e4709 | [
"MIT"
] | 2 | 2019-12-23T15:47:02.000Z | 2020-01-06T09:51:57.000Z | shell/control.py | badfish5150/shellsploit-framework | 22bb910d33379ca29ddd10ba93a63e9ff1eab99d | [
"MIT"
] | null | null | null | shell/control.py | badfish5150/shellsploit-framework | 22bb910d33379ca29ddd10ba93a63e9ff1eab99d | [
"MIT"
] | 1 | 2021-12-23T16:35:24.000Z | 2021-12-23T16:35:24.000Z | #------------------Bombermans Team---------------------------------#
# Author : B3mB4m
# Concat : b3mb4m@protonmail.com
# Project : https://github.com/b3mb4m/Shellsploit
# LICENSE : https://github.com/b3mb4m/Shellsploit/blob/master/LICENSE
#------------------------------------------------------------------#
import ... | 50.883641 | 140 | 0.466683 |
import sys
import os
from .core.color import *
from re import findall
from .core.Comp import tab
from lib.base.framework import ShellsploitFramework
if sys.version_info.major >= 3:
raw_input = input
class B3mB4m(ShellsploitFramework):
def __init__(self):
ShellsploitFramework.__init__(self) ... | true | true |
790db22589642ac8d0bb393e746a8f9ce6546756 | 2,603 | py | Python | gscripts/general/venn_matrix.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 12 | 2015-07-10T09:36:49.000Z | 2021-07-06T03:25:04.000Z | gscripts/general/venn_matrix.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 43 | 2015-01-21T20:01:38.000Z | 2021-04-13T17:50:38.000Z | gscripts/general/venn_matrix.py | YeoLab/gscripts | ae653d29d0ce82d342f7f6ff5bbeedd27a2e062b | [
"MIT"
] | 19 | 2015-05-02T09:33:17.000Z | 2022-02-12T17:08:06.000Z | from matplotlib import pyplot as plt
from matplotlib_venn import venn2
import glob
import compare_two_zlists as cv
import math
from scipy.stats import hypergeom
from decimal import Decimal
from math import log
def make_venn_matrix(filename_list):
fig1 = plt.figure(1)
fig1.suptitle('Differentially Expressed Genes Ov... | 26.835052 | 84 | 0.676143 | from matplotlib import pyplot as plt
from matplotlib_venn import venn2
import glob
import compare_two_zlists as cv
import math
from scipy.stats import hypergeom
from decimal import Decimal
from math import log
def make_venn_matrix(filename_list):
fig1 = plt.figure(1)
fig1.suptitle('Differentially Expressed Genes Ov... | false | true |
790db4e57c8d5c2412f1dad6e329136609500df2 | 286 | py | Python | products/urls.py | Nenu1985/blog | df94ae3243314d43e16c33d0150a980ce34535a3 | [
"MIT"
] | null | null | null | products/urls.py | Nenu1985/blog | df94ae3243314d43e16c33d0150a980ce34535a3 | [
"MIT"
] | 13 | 2019-12-04T23:32:05.000Z | 2022-02-10T12:07:30.000Z | products/urls.py | Nenu1985/blog | df94ae3243314d43e16c33d0150a980ce34535a3 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
path('settings', views.project_settings, name='settings'),
path('envs', views.os_envs, name='envs'),
]
| 26 | 62 | 0.723776 | from django.urls import path
from . import views
urlpatterns = [
path('settings', views.project_settings, name='settings'),
path('envs', views.os_envs, name='envs'),
]
| true | true |
790db547c7710bee45f75044da74e8e17d906927 | 1,459 | py | Python | sagas/nlu/pipes/cat.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | sagas/nlu/pipes/cat.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | sagas/nlu/pipes/cat.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | from typing import Text, Any, Dict, List, Union
from blinker import NamedSignal, signal
import rx
from rx import operators as ops
from dataclasses import dataclass
from sagas.nlu.pipes import pred_cond, filter_path, to_token
from sagas.util.collection_util import wrap, to_obj
import logging
logger = logging.getLogger... | 31.042553 | 99 | 0.59767 | from typing import Text, Any, Dict, List, Union
from blinker import NamedSignal, signal
import rx
from rx import operators as ops
from dataclasses import dataclass
from sagas.nlu.pipes import pred_cond, filter_path, to_token
from sagas.util.collection_util import wrap, to_obj
import logging
logger = logging.getLogger... | true | true |
790db59cd76ff0c3662434ff66d9e89df5351087 | 6,263 | py | Python | tests/test_graph.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | 1 | 2018-08-06T03:57:51.000Z | 2018-08-06T03:57:51.000Z | tests/test_graph.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | null | null | null | tests/test_graph.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | null | null | null | from autokeras.generator import DefaultClassifierGenerator
from autokeras.graph import *
from autokeras.net_transformer import legal_graph
from tests.common import get_conv_data, get_add_skip_model, get_conv_dense_model, get_pooling_model, \
get_concat_skip_model
def test_conv_deeper_stub():
graph = get_conv_... | 26.99569 | 120 | 0.695513 | from autokeras.generator import DefaultClassifierGenerator
from autokeras.graph import *
from autokeras.net_transformer import legal_graph
from tests.common import get_conv_data, get_add_skip_model, get_conv_dense_model, get_pooling_model, \
get_concat_skip_model
def test_conv_deeper_stub():
graph = get_conv_... | true | true |
790db5e4ea2ac9b7b978a97d923cc49dca6e6b37 | 1,837 | py | Python | src/util.py | lukamaletin/multi-gan | 53b37c840d74ed0a9db888a03a5bed59ad33bc8e | [
"MIT"
] | null | null | null | src/util.py | lukamaletin/multi-gan | 53b37c840d74ed0a9db888a03a5bed59ad33bc8e | [
"MIT"
] | null | null | null | src/util.py | lukamaletin/multi-gan | 53b37c840d74ed0a9db888a03a5bed59ad33bc8e | [
"MIT"
] | null | null | null | import os
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
def make_trainable(net, val):
net.trainable = val
for layer in net.layers:
layer.trainable = val
def plot_loss(losses):
plt.figure(figsize=(10, 8))
plt.plot(losses['g'], label='generative loss')
plt.plot(... | 25.513889 | 79 | 0.623299 | import os
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
def make_trainable(net, val):
net.trainable = val
for layer in net.layers:
layer.trainable = val
def plot_loss(losses):
plt.figure(figsize=(10, 8))
plt.plot(losses['g'], label='generative loss')
plt.plot(... | true | true |
790db5f7909e370ab4ab9fd0569746d419b73c10 | 7,068 | py | Python | pyod/models/sod.py | GBR-613/pyod | bfbb297ac067c47488bcade77669c99de5a4838a | [
"BSD-2-Clause"
] | 5,126 | 2018-11-09T06:05:38.000Z | 2022-03-31T14:25:14.000Z | pyod/models/sod.py | durgeshsamariya/pyod | dfafc57f74dc3d49d0166f21ab2ddb97e3d1d898 | [
"BSD-2-Clause"
] | 325 | 2018-11-14T20:02:39.000Z | 2022-03-30T22:49:38.000Z | pyod/models/sod.py | durgeshsamariya/pyod | dfafc57f74dc3d49d0166f21ab2ddb97e3d1d898 | [
"BSD-2-Clause"
] | 1,049 | 2018-11-09T06:12:12.000Z | 2022-03-31T06:21:28.000Z | # -*- coding: utf-8 -*-
"""Subspace Outlier Detection (SOD)
"""
# Author: Yahya Almardeny <almardeny@gmail.com>
# License: BSD 2 clause
import numpy as np
import numba as nb
from sklearn.neighbors import NearestNeighbors
from sklearn.utils import check_array
from ..utils.utility import check_parameter
from .base impo... | 35.164179 | 79 | 0.621817 |
import numpy as np
import numba as nb
from sklearn.neighbors import NearestNeighbors
from sklearn.utils import check_array
from ..utils.utility import check_parameter
from .base import BaseDetector
@nb.njit(parallel=True)
def _snn_imp(ind, ref_set_):
n = ind.shape[0]
_count = np.zeros(shape=(n, ref_set_)... | true | true |
790db68297454438cd4748af30d715a7558e6fe2 | 7,042 | py | Python | test/functional/rpc_getblockstats.py | blinkhash/blinkhash-core | e05662019c2fa4cb2dc3736f38e48492712c23b1 | [
"MIT"
] | 3 | 2021-07-27T16:59:47.000Z | 2021-12-31T20:55:46.000Z | test/functional/rpc_getblockstats.py | blinkhash/blinkhash-core | e05662019c2fa4cb2dc3736f38e48492712c23b1 | [
"MIT"
] | null | null | null | test/functional/rpc_getblockstats.py | blinkhash/blinkhash-core | e05662019c2fa4cb2dc3736f38e48492712c23b1 | [
"MIT"
] | 1 | 2021-12-31T12:58:23.000Z | 2021-12-31T12:58:23.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test getblockstats rpc call
#
from test_framework.blocktools import COINBASE_MATURITY
from test_fram... | 41.916667 | 121 | 0.629225 |
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BlinkhashTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
import json
import os
TESTSDIR = os.path.dirname(os.path.realpath(__file__))
class GetblockstatsTest(Blin... | true | true |
790db7299eb21cb742977befe834ae4e20ae0093 | 4,040 | py | Python | transformer/transformers/map_keys.py | santunioni/transformer | a34b8b40cba81382c8483d590050c3e36cee5bff | [
"MIT"
] | 1 | 2022-02-21T22:15:08.000Z | 2022-02-21T22:15:08.000Z | transformer/transformers/map_keys.py | santunioni/Transformer | a34b8b40cba81382c8483d590050c3e36cee5bff | [
"MIT"
] | null | null | null | transformer/transformers/map_keys.py | santunioni/Transformer | a34b8b40cba81382c8483d590050c3e36cee5bff | [
"MIT"
] | null | null | null | from typing import Any, Dict, Mapping, Optional, Set
from pydantic import validator
from transformer.transformers.abstract import ExtraHashableModel, Transformer
from transformer.transformers.flatters import Flatter, FlatterConfig, Unflatter
class ReportMissingData(Exception):
def __init__(self, keys: Set[str])... | 40.4 | 117 | 0.661634 | from typing import Any, Dict, Mapping, Optional, Set
from pydantic import validator
from transformer.transformers.abstract import ExtraHashableModel, Transformer
from transformer.transformers.flatters import Flatter, FlatterConfig, Unflatter
class ReportMissingData(Exception):
def __init__(self, keys: Set[str])... | true | true |
790db8137d4ea765b0aab062d890ecbd67994b6d | 2,571 | py | Python | tests/providers/microsoft/azure/transfers/test_local_to_wasb.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | tests/providers/microsoft/azure/transfers/test_local_to_wasb.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | tests/providers/microsoft/azure/transfers/test_local_to_wasb.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 40.171875 | 105 | 0.710618 |
import datetime
import unittest
from unittest import mock
from airflow.models.dag import DAG
from airflow.providers.microsoft.azure.transfers.local_to_wasb import LocalFilesystemToWasbOperator
class TestLocalFilesystemToWasbOperator(unittest.TestCase):
_config = {
'file_path': 'file',... | true | true |
790db84293b6d95fe47f418cd8e8dee9afcd0519 | 461 | py | Python | Exercises/Exercises_01/07_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 7 | 2021-12-28T23:38:42.000Z | 2022-03-29T16:36:16.000Z | Exercises/Exercises_01/07_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | null | null | null | Exercises/Exercises_01/07_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 4 | 2021-06-29T20:21:52.000Z | 2022-03-12T10:04:17.000Z | # Dana jest posortowana tablica A[1, ..., n] oraz liczba x. Proszę napisać program, który stwierdza
# czy istnieją indeksy i oraz j takie, że A[i] + A[j] = x.
def sum_search(T, x):
l = 0
r = len(T) - 1
while l <= r:
if T[l] + T[r] == x:
return True
elif T[l] + T[r] > x:
... | 21.952381 | 99 | 0.488069 |
def sum_search(T, x):
l = 0
r = len(T) - 1
while l <= r:
if T[l] + T[r] == x:
return True
elif T[l] + T[r] > x:
r -= 1
else:
l += 1
return False
T = [2, 5, 8, 12, 16, 19, 20, 25, 34, 55, 81]
x = 37
print(sum_search(T, x))
| true | true |
790db85459ceb8b54c79ae5345c445b6c1fb5bd1 | 21,310 | py | Python | matchms/old/ms_similarity_classical.py | matchms/old-iomega-spec2vec | 216b8f8b5e4ffd320b4575326a05fb6c7cd28223 | [
"Apache-2.0"
] | null | null | null | matchms/old/ms_similarity_classical.py | matchms/old-iomega-spec2vec | 216b8f8b5e4ffd320b4575326a05fb6c7cd28223 | [
"Apache-2.0"
] | null | null | null | matchms/old/ms_similarity_classical.py | matchms/old-iomega-spec2vec | 216b8f8b5e4ffd320b4575326a05fb6c7cd28223 | [
"Apache-2.0"
] | 1 | 2020-07-04T23:28:55.000Z | 2020-07-04T23:28:55.000Z | #
# Spec2Vec
#
# Copyright 2019 Netherlands eScience Center
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 37.783688 | 103 | 0.57114 |
import numba
import numpy as np
from scipy.optimize import linear_sum_assignment
from scipy import spatial
from concurrent.futures import ThreadPoolExecutor
def mol_sim_matrix(fingerprints1,
fingerprints2,
method='cosine',
filename=None,
... | true | true |
790db8ba305a6bee2517597e27a90ff727edd601 | 7,725 | py | Python | pymc3/distributions/mixture.py | rsumner31/pymc3-2 | e824294ddfb45610536cad07394b8c290904c38d | [
"Apache-2.0"
] | null | null | null | pymc3/distributions/mixture.py | rsumner31/pymc3-2 | e824294ddfb45610536cad07394b8c290904c38d | [
"Apache-2.0"
] | null | null | null | pymc3/distributions/mixture.py | rsumner31/pymc3-2 | e824294ddfb45610536cad07394b8c290904c38d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import theano.tensor as tt
from pymc3.util import get_variable_name
from ..math import logsumexp
from .dist_math import bound
from .distribution import Discrete, Distribution, draw_values, generate_samples
from .continuous import get_tau_sd, Normal
def all_discrete(comp_dists):
"""
Determi... | 34.486607 | 119 | 0.535016 | import numpy as np
import theano.tensor as tt
from pymc3.util import get_variable_name
from ..math import logsumexp
from .dist_math import bound
from .distribution import Discrete, Distribution, draw_values, generate_samples
from .continuous import get_tau_sd, Normal
def all_discrete(comp_dists):
if isinstance(c... | true | true |
790db9c95aa81be22336050a55df0924b1114b92 | 2,080 | py | Python | Clients/ParaView/Testing/Python/AppendAttributes.py | xj361685640/ParaView | 0a27eef5abc5a0c0472ab0bc806c4db881156e64 | [
"Apache-2.0",
"BSD-3-Clause"
] | 815 | 2015-01-03T02:14:04.000Z | 2022-03-26T07:48:07.000Z | Clients/ParaView/Testing/Python/AppendAttributes.py | xj361685640/ParaView | 0a27eef5abc5a0c0472ab0bc806c4db881156e64 | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2015-04-28T20:10:37.000Z | 2021-08-20T18:19:01.000Z | Clients/ParaView/Testing/Python/AppendAttributes.py | xj361685640/ParaView | 0a27eef5abc5a0c0472ab0bc806c4db881156e64 | [
"Apache-2.0",
"BSD-3-Clause"
] | 328 | 2015-01-22T23:11:46.000Z | 2022-03-14T06:07:52.000Z | #/usr/bin/env python
from paraview.simple import *
import sys
wavelet1 = Wavelet()
wavelet2 = Wavelet()
pythonCalculator1 = PythonCalculator(Input=wavelet2)
pythonCalculator1.ArrayName = 'RTData'
pythonCalculator1.Expression = 'RTData+200'
pythonCalculator1.CopyArrays = 0
# this one should be ignored in the output s... | 35.862069 | 92 | 0.755288 |
from paraview.simple import *
import sys
wavelet1 = Wavelet()
wavelet2 = Wavelet()
pythonCalculator1 = PythonCalculator(Input=wavelet2)
pythonCalculator1.ArrayName = 'RTData'
pythonCalculator1.Expression = 'RTData+200'
pythonCalculator1.CopyArrays = 0
sphereSource = Sphere()
appendAttributes1 = AppendAttributes(... | true | true |
790dbb66da0d930c4aacd463d876583994ead967 | 182 | py | Python | python_ex/01ex.py | llinmeng/PythonStudy | 68c27eaa302b95aa4fb35d794f0d645f98b832dd | [
"MIT"
] | null | null | null | python_ex/01ex.py | llinmeng/PythonStudy | 68c27eaa302b95aa4fb35d794f0d645f98b832dd | [
"MIT"
] | null | null | null | python_ex/01ex.py | llinmeng/PythonStudy | 68c27eaa302b95aa4fb35d794f0d645f98b832dd | [
"MIT"
] | null | null | null | print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print "Yay! Printing"
print "Id much rather you 'not'."
print 'I "said" do not touch this.'
| 22.75 | 35 | 0.697802 | print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print "Yay! Printing"
print "Id much rather you 'not'."
print 'I "said" do not touch this.'
| false | true |
790dbc3fe1067ad92b9c1bc56af87986404f11fa | 202 | py | Python | services/resource/project/utils/enums.py | spruce-cq/sblog | 287571bffcf19c224d3b4ad4e4e9347225245350 | [
"MIT"
] | null | null | null | services/resource/project/utils/enums.py | spruce-cq/sblog | 287571bffcf19c224d3b4ad4e4e9347225245350 | [
"MIT"
] | 7 | 2020-09-07T15:06:12.000Z | 2022-02-26T19:09:01.000Z | services/resource/project/utils/enums.py | spruce-cq/sblog | 287571bffcf19c224d3b4ad4e4e9347225245350 | [
"MIT"
] | null | null | null | # services/resource/project/utils/enums.py
from enum import Enum
class Status(Enum):
normal = 0
delete = 1
other = 2
class Scope(Enum):
user = 'UserScope'
admin = 'AdminScope'
| 12.625 | 42 | 0.643564 |
from enum import Enum
class Status(Enum):
normal = 0
delete = 1
other = 2
class Scope(Enum):
user = 'UserScope'
admin = 'AdminScope'
| true | true |
790dbc43e17a08ab4288c2517635a930ec91e743 | 1,594 | py | Python | quora/pyfm/generate_interaction.py | zonemercy/Kaggle | 35ecb08272b6491f5e6756c97c7dec9c46a13a43 | [
"MIT"
] | 17 | 2017-10-01T00:10:19.000Z | 2022-02-07T12:11:01.000Z | quora/pyfm/generate_interaction.py | zonemercy/Kaggle | 35ecb08272b6491f5e6756c97c7dec9c46a13a43 | [
"MIT"
] | null | null | null | quora/pyfm/generate_interaction.py | zonemercy/Kaggle | 35ecb08272b6491f5e6756c97c7dec9c46a13a43 | [
"MIT"
] | 1 | 2019-08-15T03:58:51.000Z | 2019-08-15T03:58:51.000Z | import os
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder,LabelEncoder,StandardScaler
from sklearn.decomposition import TruncatedSVD,PCA
from sklearn.metrics.pairwise import cosine_similarity,pairwise_distances
from sklearn.feature_extraction.text import TfidfVectorizer
SEED = 204... | 45.542857 | 134 | 0.788582 | import os
import numpy as np
import pandas as pd
from sklearn.preprocessing import OneHotEncoder,LabelEncoder,StandardScaler
from sklearn.decomposition import TruncatedSVD,PCA
from sklearn.metrics.pairwise import cosine_similarity,pairwise_distances
from sklearn.feature_extraction.text import TfidfVectorizer
SEED = 204... | true | true |
790dbd0078150244cae8de4b721c0c6c27361515 | 779 | py | Python | src/classification/predict_with_umap.py | menchelab/UMAPanalysis | 09f9b4a7823f6eceb6b40e25ee21412f3bf1c7fe | [
"MIT"
] | 2 | 2022-02-27T19:19:36.000Z | 2022-03-15T10:38:36.000Z | src/classification/predict_with_umap.py | menchelab/UMAPanalysis | 09f9b4a7823f6eceb6b40e25ee21412f3bf1c7fe | [
"MIT"
] | null | null | null | src/classification/predict_with_umap.py | menchelab/UMAPanalysis | 09f9b4a7823f6eceb6b40e25ee21412f3bf1c7fe | [
"MIT"
] | null | null | null | import sys
import re
import pandas as pd
network_filename = sys.argv[1]
m = re.match("networks/(?P<dataset>.*?)_similarity", network_filename)
dataset = m.groupdict()['dataset']
G=nx.read_gml(network_filename)
labels=pd.read_csv(f"munged_data/{dataset}/labels.csv", index_col=0)
metadata = pd.read_csv(f"data/intermed... | 33.869565 | 86 | 0.762516 | import sys
import re
import pandas as pd
network_filename = sys.argv[1]
m = re.match("networks/(?P<dataset>.*?)_similarity", network_filename)
dataset = m.groupdict()['dataset']
G=nx.read_gml(network_filename)
labels=pd.read_csv(f"munged_data/{dataset}/labels.csv", index_col=0)
metadata = pd.read_csv(f"data/intermed... | true | true |
790dbdcf0a9d7aaa327e40cf4253ecb288613544 | 596 | py | Python | keyword_relation/migrations/0011_keyword_grouping.py | rohanjsuresh/extracted_keyword_validation | 94e56c645c066d9d20097433b1716b3e76625b3d | [
"MIT"
] | null | null | null | keyword_relation/migrations/0011_keyword_grouping.py | rohanjsuresh/extracted_keyword_validation | 94e56c645c066d9d20097433b1716b3e76625b3d | [
"MIT"
] | null | null | null | keyword_relation/migrations/0011_keyword_grouping.py | rohanjsuresh/extracted_keyword_validation | 94e56c645c066d9d20097433b1716b3e76625b3d | [
"MIT"
] | 1 | 2021-05-18T16:40:55.000Z | 2021-05-18T16:40:55.000Z | # Generated by Django 3.0.8 on 2021-07-07 22:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('keyword_relation', '0010_auto_20210322_2049'),
]
operations = [
migrations.CreateModel(
name='Keyword_Grouping',
fie... | 27.090909 | 114 | 0.588926 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('keyword_relation', '0010_auto_20210322_2049'),
]
operations = [
migrations.CreateModel(
name='Keyword_Grouping',
fields=[
('id', models.AutoField(a... | true | true |
790dbe9c2575b584fcde93e4a4489e80e4e28895 | 1,455 | py | Python | xlsxwriter/test/comparison/test_chart_scatter03.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_scatter03.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_scatter03.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 26.454545 | 79 | 0.538832 | true | true | |
790dbf8c0033ff8b410ae68d704d1f7f043f9f53 | 1,090 | py | Python | rules/javascript/CVI_3003.py | dahua966/Kunlun-M | 978dd0650b555a677d2c5d74fc86ff66319a2d57 | [
"MIT"
] | 1 | 2021-06-25T01:44:45.000Z | 2021-06-25T01:44:45.000Z | rules/javascript/CVI_3003.py | dahua966/Kunlun-M | 978dd0650b555a677d2c5d74fc86ff66319a2d57 | [
"MIT"
] | null | null | null | rules/javascript/CVI_3003.py | dahua966/Kunlun-M | 978dd0650b555a677d2c5d74fc86ff66319a2d57 | [
"MIT"
] | 2 | 2020-12-09T08:26:45.000Z | 2021-04-12T03:24:34.000Z | # -*- coding: utf-8 -*-
"""
auto rule template
~~~~
:author: LoRexxar <LoRexxar@gmail.com>
:homepage: https://github.com/LoRexxar/Kunlun-M
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2017 LoRexxar. All rights reserved
"""
from utils.api import *
class CVI_300... | 20.185185 | 64 | 0.555046 |
from utils.api import *
class CVI_3003():
def __init__(self):
self.svid = 3003
self.language = "javascript"
self.author = "LoRexxar"
self.vulnerability = "RCE"
self.description = "remote? code exec"
self.status = True
self.match_mode... | true | true |
790dc041534631695a4a573017e279551b20bf64 | 24,594 | py | Python | tests/test_georaster_tiling.py | SimoneDeGasperis/telluric | 2fe4388f4a69a5a939078a876943c5f4620693ca | [
"MIT"
] | 81 | 2018-04-12T12:29:06.000Z | 2022-03-17T09:41:55.000Z | tests/test_georaster_tiling.py | SimoneDeGasperis/telluric | 2fe4388f4a69a5a939078a876943c5f4620693ca | [
"MIT"
] | 283 | 2018-04-09T11:32:25.000Z | 2022-03-25T22:16:38.000Z | tests/test_georaster_tiling.py | SimoneDeGasperis/telluric | 2fe4388f4a69a5a939078a876943c5f4620693ca | [
"MIT"
] | 22 | 2018-04-09T10:53:52.000Z | 2022-02-09T10:38:33.000Z | import os
import rasterio
import mercantile
import numpy as np
import pytest
from tempfile import NamedTemporaryFile, TemporaryDirectory
from affine import Affine
from unittest import TestCase
from unittest.mock import patch
from datetime import datetime
from shapely.geometry import Polygon
from rasterio.enums impo... | 41.684746 | 113 | 0.654591 | import os
import rasterio
import mercantile
import numpy as np
import pytest
from tempfile import NamedTemporaryFile, TemporaryDirectory
from affine import Affine
from unittest import TestCase
from unittest.mock import patch
from datetime import datetime
from shapely.geometry import Polygon
from rasterio.enums impo... | true | true |
790dc05f4c0d5872bd7a197900cdb588ebac477b | 6,501 | py | Python | client-autosense/sense/sqlite_syn.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | client-autosense/sense/sqlite_syn.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | client-autosense/sense/sqlite_syn.py | zxypic/PublicPic | 8bec621e38955fb061220bf56c2961122651ff9d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sqlite3
import logging
logger = logging.getLogger("xtc")
class sqlite_handle(object):
def __init__(self):
self.dbname = "Xsense.db"
self.conn = None
def db_init(self): # 初始化db task_info、apps、scripts、run_tasks
self.db_table_all()
conn... | 36.318436 | 167 | 0.591601 |
import os
import sqlite3
import logging
logger = logging.getLogger("xtc")
class sqlite_handle(object):
def __init__(self):
self.dbname = "Xsense.db"
self.conn = None
def db_init(self):
self.db_table_all()
conn = sqlite3.connect(self.dbname)
try:
for cr... | true | true |
790dc1204f7d88fa8e7a6bfc76e42000069a6612 | 1,009 | py | Python | grid/migrations/0002_image.py | greatdaniels/gallery-app | e4749ca4ab02b0715e707856aa9d28cc66b7ebc5 | [
"MIT"
] | null | null | null | grid/migrations/0002_image.py | greatdaniels/gallery-app | e4749ca4ab02b0715e707856aa9d28cc66b7ebc5 | [
"MIT"
] | 4 | 2020-06-06T01:10:11.000Z | 2021-09-08T02:04:23.000Z | grid/migrations/0002_image.py | greatdaniels/gallery-app | e4749ca4ab02b0715e707856aa9d28cc66b7ebc5 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-24 13:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('grid', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Image',
fiel... | 37.37037 | 114 | 0.60555 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('grid', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', models.AutoField(au... | true | true |
790dc142b9a7987a252d5c15f3f5739223b31b94 | 9,171 | py | Python | segnet_v7.py | vietnamican/Deep-Image-Matting | 436487e680027f07387700fb8ee1486635b82335 | [
"MIT"
] | null | null | null | segnet_v7.py | vietnamican/Deep-Image-Matting | 436487e680027f07387700fb8ee1486635b82335 | [
"MIT"
] | null | null | null | segnet_v7.py | vietnamican/Deep-Image-Matting | 436487e680027f07387700fb8ee1486635b82335 | [
"MIT"
] | null | null | null | import tensorflow.keras.backend as K
import tensorflow as tf
from tensorflow.keras.layers import Input, Conv2D, UpSampling2D, BatchNormalization, ZeroPadding2D, MaxPooling2D, Reshape, \
Concatenate, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras.utils import multi_gpu_model
from tensorflow.k... | 44.736585 | 141 | 0.637771 | import tensorflow.keras.backend as K
import tensorflow as tf
from tensorflow.keras.layers import Input, Conv2D, UpSampling2D, BatchNormalization, ZeroPadding2D, MaxPooling2D, Reshape, \
Concatenate, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras.utils import multi_gpu_model
from tensorflow.k... | true | true |
790dc17972f0343866fcf1c4348d39c89d4aaf8e | 358 | py | Python | app/recipe/urls.py | Webins/recipe-app-api | 9972d634e3d09969331d48180b6ae24e1dee3d6b | [
"MIT"
] | 1 | 2020-07-22T16:29:21.000Z | 2020-07-22T16:29:21.000Z | app/recipe/urls.py | Webins/recipe-app-api | 9972d634e3d09969331d48180b6ae24e1dee3d6b | [
"MIT"
] | null | null | null | app/recipe/urls.py | Webins/recipe-app-api | 9972d634e3d09969331d48180b6ae24e1dee3d6b | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredients', views.IngredientViewSet)
router.register('recipe', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns = [... | 23.866667 | 55 | 0.77933 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from recipe import views
router = DefaultRouter()
router.register('tags', views.TagViewSet)
router.register('ingredients', views.IngredientViewSet)
router.register('recipe', views.RecipeViewSet)
app_name = 'recipe'
urlpatterns = [... | true | true |
790dc1ec4b631e70e3b7f9f8d7c83a86604e4e4a | 4,903 | py | Python | src/octopus/image/source.py | gar-syn/congo-lab | dc50af4e35903556bc8bc34dc23a7a708c1f5422 | [
"MIT"
] | 1 | 2021-02-02T11:27:25.000Z | 2021-02-02T11:27:25.000Z | src/octopus/image/source.py | gar-syn/congo-lab | dc50af4e35903556bc8bc34dc23a7a708c1f5422 | [
"MIT"
] | 18 | 2021-02-01T11:35:15.000Z | 2021-08-03T14:23:38.000Z | src/octopus/image/source.py | gar-syn/congo-lab | dc50af4e35903556bc8bc34dc23a7a708c1f5422 | [
"MIT"
] | null | null | null | # System Imports
import cv2
import json
from typing import Optional
# Library imports
import numpy
# Twisted Import
from twisted.internet import reactor, defer, threads, protocol
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.interfaces import IAddress
# Package Imports
from .data im... | 29.011834 | 90 | 0.598409 |
import cv2
import json
from typing import Optional
import numpy
from twisted.internet import reactor, defer, threads, protocol
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.interfaces import IAddress
from .data import Image, ColorSpace
class cv_webcam (object):
def __init__... | true | true |
790dc1f7c437946d2beb40380f654fcc078627c4 | 742 | py | Python | projects/g3h2-algorithm/practice1/4.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/4.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/4.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | def get_the_ith_largest(s1: list, s2: list, i: int):
m = len(s1)
n = len(s2)
if i > m + n:
raise IndexError('list index out of range')
i -= 1
l1 = 0
r1 = i if m - 1 >= i else m - 1
while l1 <= r1:
c1 = (l1 + r1) // 2
c1_f = i - c1 - 1
c1_b = i - c1
i... | 25.586207 | 65 | 0.467655 | def get_the_ith_largest(s1: list, s2: list, i: int):
m = len(s1)
n = len(s2)
if i > m + n:
raise IndexError('list index out of range')
i -= 1
l1 = 0
r1 = i if m - 1 >= i else m - 1
while l1 <= r1:
c1 = (l1 + r1) // 2
c1_f = i - c1 - 1
c1_b = i - c1
i... | true | true |
790dc2d561a18c3dd73fe88534f970fb94f4432e | 2,498 | py | Python | UMLRT2Kiltera_MM/Properties/from_thesis/HMM10_then1_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | UMLRT2Kiltera_MM/Properties/from_thesis/HMM10_then1_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | UMLRT2Kiltera_MM/Properties/from_thesis/HMM10_then1_IsolatedLHS.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM10_then1_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HMM10_then1_IsolatedLHS.
"""
# Flag this insta... | 43.068966 | 125 | 0.5004 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM10_then1_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
self.is_compiled = True
super(HMM10_then1_IsolatedLHS, self).__init__(name='HMM10_then1_IsolatedLHS', n... | true | true |
790dc41206388cb2bb9037ec3e469e9e586a2a2e | 14,501 | py | Python | libai/data/datasets/bert_dataset.py | Oneflow-Inc/libai | e473bd3962f07b1e37232d2be39c8257df0ec0f3 | [
"Apache-2.0"
] | 55 | 2021-12-10T08:47:06.000Z | 2022-03-28T09:02:15.000Z | libai/data/datasets/bert_dataset.py | Oneflow-Inc/libai | e473bd3962f07b1e37232d2be39c8257df0ec0f3 | [
"Apache-2.0"
] | 106 | 2021-11-03T05:16:45.000Z | 2022-03-31T06:16:23.000Z | libai/data/datasets/bert_dataset.py | Oneflow-Inc/libai | e473bd3962f07b1e37232d2be39c8257df0ec0f3 | [
"Apache-2.0"
] | 13 | 2021-12-29T08:12:08.000Z | 2022-03-28T06:59:45.000Z | # coding=utf-8
# Copyright 2021 The OneFlow 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 require... | 36.804569 | 99 | 0.603614 |
import collections
import math
import numpy as np
import oneflow as flow
from libai.data.data_utils import SentenceIndexedDataset
from libai.data.structures import DistTensorData, Instance
MaskedLmInstance = collections.namedtuple("MaskedLmInstance", ["index", "label"])
def is_start_piece(piece):
... | true | true |
790dc4c70bdebe3d17d0f764a7a35b9714f96983 | 43,077 | py | Python | pytorch_lightning/trainer/training_loop.py | neggert/pytorch-lightning | 8208c330eb1a4e8cca243ee525882854dd366921 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | neggert/pytorch-lightning | 8208c330eb1a4e8cca243ee525882854dd366921 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/trainer/training_loop.py | neggert/pytorch-lightning | 8208c330eb1a4e8cca243ee525882854dd366921 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 42.735119 | 119 | 0.654874 |
from contextlib import contextmanager, suppress
from copy import copy, deepcopy
from typing import Any, Dict, List, Optional, Union
import numpy as np
import torch
from pytorch_lightning.core.optimizer import LightningOptimizer
from pytorch_lightning.core.step_result import Result
from pytorch_lightning... | true | true |
790dc5834f863fef842206787568d1423fd56a03 | 2,499 | py | Python | custom/icds_reports/utils/aggregation_helpers/distributed/thr_forms_child_health.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | custom/icds_reports/utils/aggregation_helpers/distributed/thr_forms_child_health.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | custom/icds_reports/utils/aggregation_helpers/distributed/thr_forms_child_health.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_CHILD_HEALTH_THR_TABLE
from custom.icds_reports.utils.aggregation_helpers import month_formatter
from custom.icds_reports.utils.aggregation_helpers.d... | 40.967213 | 111 | 0.687875 | from __future__ import absolute_import
from __future__ import unicode_literals
from dateutil.relativedelta import relativedelta
from custom.icds_reports.const import AGG_CHILD_HEALTH_THR_TABLE
from custom.icds_reports.utils.aggregation_helpers import month_formatter
from custom.icds_reports.utils.aggregation_helpers.d... | true | true |
790dc58cba6e9460dc0cc024e7ffda0c2b5e7fde | 223 | py | Python | tests/test_formats/test_seq/asserts.py | NickleDave/conbirt | 71db6c6fd68dfef1bdbdcfacd8b2a16b21b86089 | [
"BSD-3-Clause"
] | null | null | null | tests/test_formats/test_seq/asserts.py | NickleDave/conbirt | 71db6c6fd68dfef1bdbdcfacd8b2a16b21b86089 | [
"BSD-3-Clause"
] | 3 | 2018-12-16T17:57:22.000Z | 2018-12-16T20:12:33.000Z | tests/test_formats/test_seq/asserts.py | NickleDave/conbirt | 71db6c6fd68dfef1bdbdcfacd8b2a16b21b86089 | [
"BSD-3-Clause"
] | null | null | null | def assert_rounded_correct_num_decimals(on_offset_arr, decimals):
__tracebackhide__ = True
assert all(
[len(str(float(boundary_s)).split('.')[-1]) <= decimals
for boundary_s in on_offset_arr]
)
| 31.857143 | 65 | 0.681614 | def assert_rounded_correct_num_decimals(on_offset_arr, decimals):
__tracebackhide__ = True
assert all(
[len(str(float(boundary_s)).split('.')[-1]) <= decimals
for boundary_s in on_offset_arr]
)
| true | true |
790dc5a4df3d2a6abf652c7c38db3d90988645fa | 2,617 | py | Python | commandWindow.py | sturzl/keyboardControlSocket | 8fd862c9e970174a396c13d03631e92197b59ac2 | [
"Apache-2.0"
] | null | null | null | commandWindow.py | sturzl/keyboardControlSocket | 8fd862c9e970174a396c13d03631e92197b59ac2 | [
"Apache-2.0"
] | null | null | null | commandWindow.py | sturzl/keyboardControlSocket | 8fd862c9e970174a396c13d03631e92197b59ac2 | [
"Apache-2.0"
] | null | null | null | import customSocket
import sys, pygame
#constants
windowSize = width, height = 800, 600
#displayed in the window t ogive directiosn to the driver
instructionTextLines = open('commands.txt').readlines()
activeColor = (0,175,0)
inactiveColor = (255,0,0)
textColor = (0,0,0)
screen = pygame.display.set_mode(win... | 25.910891 | 92 | 0.670615 | import customSocket
import sys, pygame
windowSize = width, height = 800, 600
instructionTextLines = open('commands.txt').readlines()
activeColor = (0,175,0)
inactiveColor = (255,0,0)
textColor = (0,0,0)
screen = pygame.display.set_mode(windowSize)
| true | true |
790dc5d903829dbda860ca4d55f8313cce6fc017 | 1,209 | py | Python | setup.py | NikitaKoshelev/aio-space-track-api | dbf7776b6afbb9ef1917ae1526fe53bb33eb0735 | [
"MIT"
] | 1 | 2017-05-19T16:18:55.000Z | 2017-05-19T16:18:55.000Z | setup.py | nkoshell/aio-space-track-api | dbf7776b6afbb9ef1917ae1526fe53bb33eb0735 | [
"MIT"
] | null | null | null | setup.py | nkoshell/aio-space-track-api | dbf7776b6afbb9ef1917ae1526fe53bb33eb0735 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import re
import sys
from distutils.core import setup
import os
if sys.version_info < (3, 5, 0):
raise RuntimeError("aio-space-track-api requires Python 3.5.0+")
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
VERSION_REGEXP = re.compile(r"^__version__ = [\'\"](.+?... | 26.866667 | 98 | 0.671629 |
import codecs
import re
import sys
from distutils.core import setup
import os
if sys.version_info < (3, 5, 0):
raise RuntimeError("aio-space-track-api requires Python 3.5.0+")
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
VERSION_REGEXP = re.compile(r"^__version__ = [\'\"](.+?)[\'\"]$", re.MULTILINE... | true | true |
790dc5ee729167a086621216d1bf4f04687ccc62 | 3,575 | py | Python | scrips/search_selfcenter/run_selfcenter_search.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | scrips/search_selfcenter/run_selfcenter_search.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | scrips/search_selfcenter/run_selfcenter_search.py | lonelu/Metalprot | e51bee472c975aa171bdb6ee426a07ca69f110ee | [
"MIT"
] | null | null | null | #You can either add the python package path.
#sys.path.append(r'/mnt/e/GitHub_Design/Metalprot')
from metalprot.search import search_selfcenter
from metalprot.basic import filter
import pickle
import time
import prody as pr
'''
python /mnt/e/GitHub_Design/Metalprot/scrips/search_selfcenter/run_selfcenter_search.py
''... | 30.555556 | 134 | 0.687552 |
from metalprot.search import search_selfcenter
from metalprot.basic import filter
import pickle
import time
import prody as pr
start_time = time.time()
query_dir = '/mnt/e/DesignData/ligands/ZN_rcsb_datesplit/20211013/20211013_selfcenter/pickle_noCYS/'
with open(query_dir + 'all_metal_vdm.pkl', 'rb') as f:
que... | true | true |
790dc638b44f4387a90ba0b5662e7ebdc15d51ee | 3,092 | py | Python | examples/cluster/plot_digits_linkage.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | examples/cluster/plot_digits_linkage.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 29 | 2021-03-04T02:56:48.000Z | 2021-04-06T04:06:45.000Z | examples/cluster/plot_digits_linkage.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 12 | 2021-02-05T20:33:04.000Z | 2022-02-17T04:11:25.000Z | """
=============================================================================
Various Agglomerative Clustering on a 2D embedding of digits
=============================================================================
An illustration of various linkage option for agglomerative clustering on
a 2D embedding of the di... | 33.608696 | 77 | 0.614166 |
print(__doc__)
from time import time
import numpy as np
from scipy import ndimage
from matplotlib import pyplot as plt
from sklearn import manifold, datasets
X, y = datasets.load_digits(return_X_y=True)
n_samples, n_features = X.shape
np.random.seed(0)
def nudge_images(X, y):
shift = la... | true | true |
790dc67de74e78dc435d99eafd8bb9751781cbb1 | 6,253 | py | Python | qiushaoyi/programs/qsy_program_codes/python3-webapp/www/coroweb.py | qsyPython/Python_play_now | 278b6d5d30082f8f93b26902c854737c4919405a | [
"MIT"
] | 2 | 2018-03-29T08:26:17.000Z | 2019-06-17T10:56:19.000Z | qiushaoyi/programs/qsy_program_codes/python3-webapp/www/coroweb.py | qsyPython/Python_play_now | 278b6d5d30082f8f93b26902c854737c4919405a | [
"MIT"
] | 1 | 2022-03-22T20:26:08.000Z | 2022-03-22T20:26:08.000Z | qiushaoyi/programs/qsy_program_codes/python3-webapp/www/coroweb.py | qsyPython/Python_play_now | 278b6d5d30082f8f93b26902c854737c4919405a | [
"MIT"
] | 1 | 2019-02-18T10:44:20.000Z | 2019-02-18T10:44:20.000Z |
# ======🙋🙋🙋实现了 1个函数fn 映射 为1个URL处理函数!!!
import asyncio, os, inspect, logging, functools
from urllib import parse
from aiohttp import web
from apis import APIError
def get(path):
'''
Define decorator @get('/path')
'''
def decorator(func):
@functools.wraps(func)
def wrapper(*args, *... | 36.567251 | 167 | 0.581481 |
import asyncio, os, inspect, logging, functools
from urllib import parse
from aiohttp import web
from apis import APIError
def get(path):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
return func(*args, **kw)
wrapper.__method__ = 'GET'
wrappe... | true | true |
790dc7a15f3e10652fa91d703d5d33b46dee027c | 3,734 | py | Python | python/fasta/seqlength.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 10 | 2016-01-13T00:39:30.000Z | 2020-11-30T05:56:19.000Z | python/fasta/seqlength.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 1 | 2017-02-09T22:46:49.000Z | 2017-02-09T22:46:49.000Z | python/fasta/seqlength.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 10 | 2015-10-09T00:29:16.000Z | 2019-06-09T05:32:15.000Z | #!/usr/bin/python
import os, sys # low level handling, such as command line stuff
import string # string methods available
import re # regular expressions
import getopt # comand line argument handling
import math # match functions
from low import * # custom functions, written by myself
... | 33.044248 | 154 | 0.497054 |
import os, sys
import string
import re
import getopt
import math
from low import *
def show_help( ):
""" displays the program parameter list and usage information """
stdout( "usage: " + sys.argv[0] + " -f <path>" )
stdout( " " )
stdout( " option description" )
stdo... | false | true |
790dc821dd259e60fc21fabc45da87128247863e | 21,528 | py | Python | train.py | yeong35/MusicTransformer-Pytorch | 5cd5e1bab8dfa0ed605089d7f41430e6e0596dc8 | [
"MIT"
] | null | null | null | train.py | yeong35/MusicTransformer-Pytorch | 5cd5e1bab8dfa0ed605089d7f41430e6e0596dc8 | [
"MIT"
] | null | null | null | train.py | yeong35/MusicTransformer-Pytorch | 5cd5e1bab8dfa0ed605089d7f41430e6e0596dc8 | [
"MIT"
] | null | null | null | import os
import csv
import shutil
from datetime import datetime
from numpy import logspace
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
from torch.optim import Adam
from dataset.e_piano import create_epiano_datasets, create_pop909_datasets
... | 56.356021 | 307 | 0.645113 | import os
import csv
import shutil
from datetime import datetime
from numpy import logspace
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import LambdaLR
from torch.utils.data import DataLoader
from torch.optim import Adam
from dataset.e_piano import create_epiano_datasets, create_pop909_datasets
... | true | true |
790dc82fad44913c8a30acf36c53c51c6aad0661 | 7,486 | py | Python | mayan/apps/web_links/views.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/web_links/views.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/web_links/views.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | import logging
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import RedirectView
from mayan.apps.acls.models import AccessControlList
from mayan.apps.docum... | 34.027273 | 78 | 0.687016 | import logging
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views.generic import RedirectView
from mayan.apps.acls.models import AccessControlList
from mayan.apps.docum... | true | true |
790dc9935531c6d0395bf850f4f155b21979dd25 | 4,273 | py | Python | Module 2/B04710_CodeBundle/Chapter 4/B04170_04_Python_Draft_01.py | wagnerhsu/packt-Object-oriented-programming-for-JavaScript-developers | a305fabfa0195e7a6e57a4fe57ff9b4f1d55bdcc | [
"MIT"
] | 8 | 2016-10-16T13:01:30.000Z | 2021-11-08T13:10:17.000Z | Module 2/B04710_CodeBundle/Chapter 4/B04170_04_Python_Draft_01.py | wagnerhsu/packt-Object-oriented-programming-for-JavaScript-developers | a305fabfa0195e7a6e57a4fe57ff9b4f1d55bdcc | [
"MIT"
] | null | null | null | Module 2/B04710_CodeBundle/Chapter 4/B04170_04_Python_Draft_01.py | wagnerhsu/packt-Object-oriented-programming-for-JavaScript-developers | a305fabfa0195e7a6e57a4fe57ff9b4f1d55bdcc | [
"MIT"
] | 5 | 2016-08-24T09:43:42.000Z | 2019-11-20T10:54:29.000Z | class Animal:
_number_of_legs = 0
_pairs_of_eyes = 0
def __init__(self, age):
self._age = age
print("Animal created")
@property
def age(self):
return self._age
@age.setter
def age(self, age):
self._age = age
def print_legs_and_eyes(self... | 23.097297 | 110 | 0.608238 | class Animal:
_number_of_legs = 0
_pairs_of_eyes = 0
def __init__(self, age):
self._age = age
print("Animal created")
@property
def age(self):
return self._age
@age.setter
def age(self, age):
self._age = age
def print_legs_and_eyes(self... | true | true |
790dc993af14fbf202955f5e6c992d231e8d2f2f | 812 | py | Python | tests/test_function_definition.py | joseph-hellerstein/symSBML-deprecated | 197f1860bb2e8c5648b3d95d51f8b774fadcaa68 | [
"MIT"
] | 1 | 2021-01-10T03:39:59.000Z | 2021-01-10T03:39:59.000Z | tests/test_function_definition.py | joseph-hellerstein/symSBML-deprecated | 197f1860bb2e8c5648b3d95d51f8b774fadcaa68 | [
"MIT"
] | null | null | null | tests/test_function_definition.py | joseph-hellerstein/symSBML-deprecated | 197f1860bb2e8c5648b3d95d51f8b774fadcaa68 | [
"MIT"
] | 3 | 2020-08-06T08:02:31.000Z | 2022-01-16T18:08:35.000Z | """
Tests for Reactions
"""
from src.common import constants as cn
from src.common.simple_sbml import SimpleSBML
from src.common import simple_sbml
from src.common.function_definition import FunctionDefinition
from tests.common import helpers
import copy
import libsbml
import numpy as np
import unittest
IGNORE_TEST ... | 21.368421 | 69 | 0.716749 | from src.common import constants as cn
from src.common.simple_sbml import SimpleSBML
from src.common import simple_sbml
from src.common.function_definition import FunctionDefinition
from tests.common import helpers
import copy
import libsbml
import numpy as np
import unittest
IGNORE_TEST = False
IS_PLOT = False
| true | true |
790dc9cd46fdf4e0494e3bb706af8f1b46702da5 | 2,002 | py | Python | ex35.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | ex35.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | ex35.py | Eithandarphyo51/python-test-exercises | 85d1cbb82fc878315be46d168e5eb0f949c6ded4 | [
"MIT"
] | null | null | null | from sys import exit
def gold_room():
print("This room is full of gold. How much do you t ake?")
choice = input("> ")
if "0" in choice or "1" in choice:
how_much = int(choice)
else:
dead("Man, learn to type a number.")
if how_much < 50:
print("Nice, you're not gre... | 25.025 | 83 | 0.564935 | from sys import exit
def gold_room():
print("This room is full of gold. How much do you t ake?")
choice = input("> ")
if "0" in choice or "1" in choice:
how_much = int(choice)
else:
dead("Man, learn to type a number.")
if how_much < 50:
print("Nice, you're not gre... | true | true |
790dcb854858e35c21f05a12f5c5e59fd69b88de | 17,505 | py | Python | tensor2tensor/data_generators/algorithmic.py | shankharaj29/tensor2tensor | b89ba51a6fa9e0c20009cfb57ee8de04f7138392 | [
"Apache-2.0"
] | 1 | 2019-02-16T10:39:45.000Z | 2019-02-16T10:39:45.000Z | tensor2tensor/data_generators/algorithmic.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/algorithmic.py | PedroLelis/tensor2tensor | 5a867d031bd493eeb7d2776e1118d1594ff0a623 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 32.06044 | 87 | 0.70517 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import numpy as np
from six.moves import range
from tensor2tensor.data_generators import generator_utils as utils
from tensor2tensor.data_generators import problem
from ... | true | true |
790dcc8a39bc21aaba4a154ea6758f2c3a81d1da | 4,509 | py | Python | tests/test_mysql_build.py | littlewatkins/nepc | 3e16e3a9622ca0ebb4484c9e4af253046367773a | [
"CC0-1.0"
] | 10 | 2020-06-17T14:48:09.000Z | 2022-01-12T14:15:56.000Z | tests/test_mysql_build.py | littlewatkins/nepc | 3e16e3a9622ca0ebb4484c9e4af253046367773a | [
"CC0-1.0"
] | 52 | 2020-06-24T20:09:43.000Z | 2022-01-16T18:24:01.000Z | tests/test_mysql_build.py | littlewatkins/nepc | 3e16e3a9622ca0ebb4484c9e4af253046367773a | [
"CC0-1.0"
] | 10 | 2020-06-18T14:24:53.000Z | 2021-10-15T19:39:42.000Z | from nepc import nepc
from nepc.util import util
import pandas as pd
import os
import pytest
import platform
# TODO: remove dependence on csv; put function in scraper that uses built-in
# readlines function
import csv
# TODO: test that all values in [nepc]/tests/data are in the nepc database
@pytest.mark.usefix... | 39.552632 | 92 | 0.578399 | from nepc import nepc
from nepc.util import util
import pandas as pd
import os
import pytest
import platform
import csv
@pytest.mark.usefixtures("data_config", "nepc_connect")
def test_states_table_has_species_metadata(data_config, nepc_connect):
NEPC_DATA = data_config[0]
number_of_states = util.wc_fxn(NE... | true | true |
790dccae985884711795bd64d05aa6e0beaa90d5 | 2,068 | py | Python | util/chplenv/chpl_unwind.py | ShreyasKhandekar/chapel | 811ad7f6cfa35c6d88f344a90743fe5f9d3c980b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | util/chplenv/chpl_unwind.py | ShreyasKhandekar/chapel | 811ad7f6cfa35c6d88f344a90743fe5f9d3c980b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | util/chplenv/chpl_unwind.py | ShreyasKhandekar/chapel | 811ad7f6cfa35c6d88f344a90743fe5f9d3c980b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import chpl_platform, overrides, third_party_utils
from utils import error, memoize, warning
@memoize
def get():
platform_val = chpl_platform.get('target')
linux = platform_val.startswith('linux64')
osx = platform_val.startswith('darwin')
val = overrides.get('CHPL_UN... | 27.210526 | 81 | 0.626692 |
import sys
import chpl_platform, overrides, third_party_utils
from utils import error, memoize, warning
@memoize
def get():
platform_val = chpl_platform.get('target')
linux = platform_val.startswith('linux64')
osx = platform_val.startswith('darwin')
val = overrides.get('CHPL_UNWIND')
if val == ... | true | true |
790dccb5c8ce8196f72ffe4f4be41dd4a837a2c2 | 1,019 | py | Python | refinery/units/pattern/xtw.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/pattern/xtw.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | refinery/units/pattern/xtw.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from refinery.units.pattern import PatternExtractor
from refinery.units import RefineryCriticalException
from refinery.lib.patterns import wallets
class xtw(PatternExtractor):
"""
Extract Wallets: Extracts anything that looks like a cryptocurrency wallet address.... | 35.137931 | 88 | 0.651619 |
from refinery.units.pattern import PatternExtractor
from refinery.units import RefineryCriticalException
from refinery.lib.patterns import wallets
class xtw(PatternExtractor):
def __init__(self, stripspace=False, duplicates=False, longest=False, take=None):
self.superinit(super(), **vars(), ascii=True,... | true | true |
790dcdff0a0df3dd5d7ac7d87dc2aa691f1779d3 | 3,132 | py | Python | finite_element_networks/lightning/callbacks.py | martenlienen/finite-element-networks | 5e8f6ecc473d1e93ccf366fcc45a47b08492ffde | [
"MIT"
] | 5 | 2022-03-21T12:39:01.000Z | 2022-03-31T06:02:01.000Z | finite_element_networks/lightning/callbacks.py | martenlienen/finite-element-networks | 5e8f6ecc473d1e93ccf366fcc45a47b08492ffde | [
"MIT"
] | null | null | null | finite_element_networks/lightning/callbacks.py | martenlienen/finite-element-networks | 5e8f6ecc473d1e93ccf366fcc45a47b08492ffde | [
"MIT"
] | 1 | 2022-03-26T02:58:58.000Z | 2022-03-26T02:58:58.000Z | import pytorch_lightning as pl
from pytorch_lightning.utilities.parsing import lightning_getattr, lightning_setattr
class MultipleShootingCallback(pl.Callback):
"""This callback increases the length of the training sequences each epoch.
This technique is well known in the SciML community and documented in th... | 43.5 | 90 | 0.715837 | import pytorch_lightning as pl
from pytorch_lightning.utilities.parsing import lightning_getattr, lightning_setattr
class MultipleShootingCallback(pl.Callback):
def __init__(
self,
*,
initial_steps: int = 3,
increase: int = 1,
target_steps_attr: str = "train_target_steps",... | true | true |
790dceeee3e32779d9ead14d2c0c4b5ea90fb07e | 1,946 | py | Python | zuul.d/octavia/tests/unit/common/test_config.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | zuul.d/octavia/tests/unit/common/test_config.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | zuul.d/octavia/tests/unit/common/test_config.py | yi-cloud/octavia | b7f5cfa4c3c454925a90c24984049539228806d7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Doug Wiegley, A10 Networks.
#
# 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 ... | 37.423077 | 79 | 0.660843 |
from oslo_config import cfg
from oslo_config import fixture as oslo_fixture
import octavia.common.config as config
import octavia.tests.unit.base as base
class TestConfig(base.TestCase):
def test_sanity(self):
config.init([])
config.setup_logging(cfg.CONF)
... | true | true |
790dd0e09ae1d8a6244aea4ae0d4ef34ef667fe1 | 771 | py | Python | server/models/bitcoin_price_API.py | johnjdailey/JS-Realtime-Dashboard | aa62cab32096fbd4bdb8be657dd99d3d162e7097 | [
"MIT"
] | null | null | null | server/models/bitcoin_price_API.py | johnjdailey/JS-Realtime-Dashboard | aa62cab32096fbd4bdb8be657dd99d3d162e7097 | [
"MIT"
] | null | null | null | server/models/bitcoin_price_API.py | johnjdailey/JS-Realtime-Dashboard | aa62cab32096fbd4bdb8be657dd99d3d162e7097 | [
"MIT"
] | null | null | null | import requests
from datetime import datetime
import psycopg2
import time
def setup():
# Create database connection
conn = psycopg2.connect(database="postgres", user="postgres",
password="password", host="127.0.0.1", port="5432")
return conn
def call_api():
URL = "https://api... | 24.870968 | 95 | 0.597925 | import requests
from datetime import datetime
import psycopg2
import time
def setup():
conn = psycopg2.connect(database="postgres", user="postgres",
password="password", host="127.0.0.1", port="5432")
return conn
def call_api():
URL = "https://api.coindesk.com/v1/bpi/current... | true | true |
790dd1c98aa84804fd6deae9806710c465315553 | 528 | py | Python | ex009a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | ex009a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | ex009a.py | emerfelippini/Curso_em_video-Aulas_Python | 5b1d78b259732bb9bbad27cd30ce91bba77c5ef0 | [
"MIT"
] | null | null | null | a = int(input('Digite um número para saber sua tabuada :'))
n1 = a*1
n2 = a*2
n3 = a*3
n4 = a*4
n5 = a*5
n6 = a*6
n7 = a*7
n8 = a*8
n9 = a*9
n10 = a*10
print('A sua tabuada é')
print('{} x 1 = {}'.format(a, n1))
print('{} x 2 = {}'.format(a, n2))
print('{} x 3 = {}'.format(a, n3))
print('{} x 4 = {}'.format(a, n4))
pri... | 24 | 59 | 0.498106 | a = int(input('Digite um número para saber sua tabuada :'))
n1 = a*1
n2 = a*2
n3 = a*3
n4 = a*4
n5 = a*5
n6 = a*6
n7 = a*7
n8 = a*8
n9 = a*9
n10 = a*10
print('A sua tabuada é')
print('{} x 1 = {}'.format(a, n1))
print('{} x 2 = {}'.format(a, n2))
print('{} x 3 = {}'.format(a, n3))
print('{} x 4 = {}'.format(a, n4))
pri... | true | true |
790dd28cf200f8e4925057ba449528fba67df010 | 158 | py | Python | projects/constants.py | IdmFoundInHim/streamsort | d55bdebd0c84d035affe087892712cf3e26974e5 | [
"MIT"
] | null | null | null | projects/constants.py | IdmFoundInHim/streamsort | d55bdebd0c84d035affe087892712cf3e26974e5 | [
"MIT"
] | 13 | 2020-04-30T20:55:17.000Z | 2021-08-23T04:02:51.000Z | projects/constants.py | IdmFoundInHim/streamsort | d55bdebd0c84d035affe087892712cf3e26974e5 | [
"MIT"
] | null | null | null | """ StreamSort Projects Extension -- Constants
Copyright (c) 2021 IdmFoundInHim, under MIT License
"""
SINGLE_MAX_MS = 15 * 60 * 1000
SINGLE_MAX_TRACKS = 4
| 22.571429 | 51 | 0.740506 | SINGLE_MAX_MS = 15 * 60 * 1000
SINGLE_MAX_TRACKS = 4
| true | true |
790dd2ae5bdef111d96c5fc9702a39c1ef79d422 | 611 | py | Python | bonus2/collateral/modules/library/test_module.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | 14 | 2020-01-24T21:52:51.000Z | 2021-05-24T01:58:08.000Z | bonus2/collateral/modules/library/test_module.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | null | null | null | bonus2/collateral/modules/library/test_module.py | kinther/ansible_course | 5ff96b857d7b1ddb359526fed128feefba8ebb90 | [
"Apache-2.0"
] | 26 | 2020-03-29T20:17:29.000Z | 2022-03-28T19:13:40.000Z | #!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
def main():
# Define your modules arguments
module_args = dict(
name=dict(type="str", required=True),
new=dict(type="bool", required=False, default=False),
)
# Create an instance of the AnsibleModule class
mo... | 23.5 | 86 | 0.690671 |
from ansible.module_utils.basic import AnsibleModule
def main():
module_args = dict(
name=dict(type="str", required=True),
new=dict(type="bool", required=False, default=False),
)
module = AnsibleModule(argument_spec=module_args, supports_check_mode=True)
result = di... | true | true |
790dd3a146c61c8a59d268a9ef30aafa08803c2b | 3,543 | py | Python | dict_interdiff.py | Zafara1/MITx-6.00.1x | 7ab0e5e188fae86685033954e774dfe07e03a639 | [
"MIT"
] | null | null | null | dict_interdiff.py | Zafara1/MITx-6.00.1x | 7ab0e5e188fae86685033954e774dfe07e03a639 | [
"MIT"
] | null | null | null | dict_interdiff.py | Zafara1/MITx-6.00.1x | 7ab0e5e188fae86685033954e774dfe07e03a639 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 14 08:23:08 2017
Author: Zachary W. Mikus
"""
#These are testing variables
d1 = {1:30, 2:20, 3:30, 5:80}
d2 = {1:40, 2:50, 3:60, 4:70}
def f(x, y):
k = x + y
return k
def commonKeys(longerList, shorterList):
commonKeyList = []
#Va... | 31.633929 | 82 | 0.686988 |
d1 = {1:30, 2:20, 3:30, 5:80}
d2 = {1:40, 2:50, 3:60, 4:70}
def f(x, y):
k = x + y
return k
def commonKeys(longerList, shorterList):
commonKeyList = []
for i in range(len(longerList)):
if longerList[i] in shorterList:
commonKeyList.append(longerList[i])
retur... | true | true |
790dd3e88fd0cb334c6be5fcb08e85a2cb6784e1 | 7,245 | py | Python | docker-images/taigav2/taiga-back/tests/integration/test_stats.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | 1 | 2017-05-29T19:01:06.000Z | 2017-05-29T19:01:06.000Z | docker-images/taigav2/taiga-back/tests/integration/test_stats.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | docker-images/taigav2/taiga-back/tests/integration/test_stats.py | mattcongy/itshop | 6be025a9eaa7fe7f495b5777d1f0e5a3184121c9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2016 Anler Hernández ... | 44.447853 | 93 | 0.696894 |
import pytest
from .. import factories as f
from tests.utils import disconnect_signals, reconnect_signals
from taiga.projects.services.stats import get_stats_for_project
pytestmark = pytest.mark.django_db
def setup_module(module):
disconnect_signals()
def teardown_module(module):
reco... | true | true |
790dd55b6ff7676f8e99726f40e97383ef46a967 | 35,128 | py | Python | Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/contrib/rnn/ops/gen_lstm_ops.py | JustinACoder/H22-GR3-UnrealAI | 361eb9ef1147f8a2991e5f98c4118cd823184adf | [
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | Lib/site-packages/tensorflow/contrib/rnn/ops/gen_lstm_ops.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/tensorflow/contrib/rnn/ops/gen_lstm_ops.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.000Z | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
"""
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import ... | 36.591667 | 2,646 | 0.624488 |
import collections as _collections
import six as _six
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from tensorflow.python.eager import execute as _execute
from tensorflow.python.f... | true | true |
790dd5c09d0dc1c89b8d4a0593284a76bc85748f | 3,042 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateRuleRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateRuleRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateRuleRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.040816 | 74 | 0.753123 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class CreateRuleRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'CreateRule')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
setattr(self, "endp... | true | true |
790dd60430b6b1e8b7c79bdda4a8bfebf564e295 | 3,307 | py | Python | src/compas_rhino/artists/lineartist.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | null | null | null | src/compas_rhino/artists/lineartist.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | null | null | null | src/compas_rhino/artists/lineartist.py | archimarkGit/compas | a953df2fca778e27bdf02437fcf8ff2b7d924c73 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
try:
basestring
except NameError:
basestring = str
import compas_rhino
from compas.utilities import iterable_like
from compas_rhino.artists._primitiveartist import PrimitiveArtist
__all__ = ['LineArt... | 30.62037 | 123 | 0.566979 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
try:
basestring
except NameError:
basestring = str
import compas_rhino
from compas.utilities import iterable_like
from compas_rhino.artists._primitiveartist import PrimitiveArtist
__all__ = ['LineArt... | true | true |
790dd6370c24d19ef81de7752b882b6cd395e555 | 1,901 | py | Python | Version2/ivan/rlcard/rlcard/agents/mcmphelp.py | guy477/Poker | d10e5af396509cd425aedc27198bb30c0709f43b | [
"MIT"
] | 2 | 2021-05-03T01:57:06.000Z | 2022-03-30T02:56:11.000Z | ignitionBot/ivan/rlcard/rlcard/agents/mcmphelp.py | guy477/Poker | d10e5af396509cd425aedc27198bb30c0709f43b | [
"MIT"
] | null | null | null | ignitionBot/ivan/rlcard/rlcard/agents/mcmphelp.py | guy477/Poker | d10e5af396509cd425aedc27198bb30c0709f43b | [
"MIT"
] | 1 | 2021-02-17T06:17:37.000Z | 2021-02-17T06:17:37.000Z | def par_UCT(rootstate, rootnode, itermax):
print('hi')
for i in range(0):
node = rootnode
state = rootstate.clone()
# Select
while node.untriedMoves == [] and node.childNodes != []: # node is fully expanded and non-terminal
node = node.UCTSelectCh... | 44.209302 | 145 | 0.557601 | def par_UCT(rootstate, rootnode, itermax):
print('hi')
for i in range(0):
node = rootnode
state = rootstate.clone()
while node.untriedMoves == [] and node.childNodes != []:
node = node.UCTSelectChild()
state.do_move(node.move)
... | false | true |
790dd65a065516ff8e7ef93065f71014e83c9436 | 1,905 | py | Python | python/eggroll/core/aspects.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | 209 | 2019-08-08T18:38:26.000Z | 2022-03-23T06:20:40.000Z | python/eggroll/core/aspects.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | 110 | 2019-08-09T02:50:47.000Z | 2022-03-07T10:30:21.000Z | python/eggroll/core/aspects.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | 77 | 2019-08-15T08:11:52.000Z | 2022-03-23T06:19:44.000Z | # Copyright (c) 2019 - now, Eggroll 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 ... | 35.943396 | 98 | 0.623097 |
import inspect
from time import time, perf_counter
from eggroll.utils.log_utils import get_logger
L = get_logger(filename='profile')
def _method_profile_logger(func):
def wrapper(*args, **kwargs):
start_wall_time = time()
start_cpu_time = perf_counter()
result = func(*ar... | true | true |
790dd66ed1fd5503977ff280cc651f855ea31907 | 501 | py | Python | examples/tutorials/parallel_distributed/mth_exception.py | lethaiq/machin | 7873cada457328952310394afeedcad4bb6a7c4a | [
"MIT"
] | 1 | 2021-04-01T21:21:23.000Z | 2021-04-01T21:21:23.000Z | examples/tutorials/parallel_distributed/mth_exception.py | lethaiq/machin | 7873cada457328952310394afeedcad4bb6a7c4a | [
"MIT"
] | null | null | null | examples/tutorials/parallel_distributed/mth_exception.py | lethaiq/machin | 7873cada457328952310394afeedcad4bb6a7c4a | [
"MIT"
] | null | null | null | from machin.parallel.thread import Thread, ThreadException
import time
def test1():
time.sleep(1)
print("Exception occurred at {}".format(time.time()))
raise RuntimeError("Error")
if __name__ == "__main__":
t1 = Thread(target=test1)
t1.start()
while True:
try:
t1.watch()
... | 22.772727 | 63 | 0.590818 | from machin.parallel.thread import Thread, ThreadException
import time
def test1():
time.sleep(1)
print("Exception occurred at {}".format(time.time()))
raise RuntimeError("Error")
if __name__ == "__main__":
t1 = Thread(target=test1)
t1.start()
while True:
try:
t1.watch()
... | true | true |
790dd67805d984f9cd1a0d14782011a31fbc0274 | 14,858 | py | Python | jina/orchestrate/deployments/config/k8s.py | gauribhutani/jina | e1e23643f8260e6917d9704b63edc54bcebbc7e9 | [
"Apache-2.0"
] | null | null | null | jina/orchestrate/deployments/config/k8s.py | gauribhutani/jina | e1e23643f8260e6917d9704b63edc54bcebbc7e9 | [
"Apache-2.0"
] | 1 | 2022-03-08T18:46:28.000Z | 2022-03-08T18:47:24.000Z | jina/orchestrate/deployments/config/k8s.py | kuraakhilesh8230/jina | 7cc23944fcdfd9944dc805ce8a116818d45317ee | [
"Apache-2.0"
] | 1 | 2022-03-17T04:50:07.000Z | 2022-03-17T04:50:07.000Z | import copy
from argparse import Namespace
from typing import Dict, Union, List, Optional, Tuple
from jina import __default_executor__
from jina.enums import PodRoleType
from jina.excepts import NoContainerizedError
from jina.orchestrate.deployments.config.k8slib import kubernetes_deployment
from jina.orchestrate.depl... | 40.485014 | 158 | 0.573428 | import copy
from argparse import Namespace
from typing import Dict, Union, List, Optional, Tuple
from jina import __default_executor__
from jina.enums import PodRoleType
from jina.excepts import NoContainerizedError
from jina.orchestrate.deployments.config.k8slib import kubernetes_deployment
from jina.orchestrate.depl... | true | true |
790dd77e78274904638c9891f524368b9cccc01a | 6,422 | py | Python | pal/generator/rust_generator.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | null | null | null | pal/generator/rust_generator.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | 1 | 2021-08-23T15:54:10.000Z | 2021-09-28T12:44:36.000Z | pal/generator/rust_generator.py | mars-research/pal | 5977394cda8750ff5dcb89c2bf193ec1ef4cd137 | [
"MIT"
] | null | null | null | import os
import pathlib
from pal.generator.abstract_generator import AbstractGenerator
from pal.logger import logger
from pal.exception import PalGeneratorException
from pal.filter import filters
from pal.transform import transforms
class RustGenerator(AbstractGenerator):
def generate_registers(self, regs, outp... | 42.25 | 84 | 0.608066 | import os
import pathlib
from pal.generator.abstract_generator import AbstractGenerator
from pal.logger import logger
from pal.exception import PalGeneratorException
from pal.filter import filters
from pal.transform import transforms
class RustGenerator(AbstractGenerator):
def generate_registers(self, regs, outp... | true | true |
790dd884584a8f5b70472b478f3fbd6d4b1e067e | 1,498 | py | Python | test/browser/window/controller/remove_handle_by_id_test.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | 2 | 2022-02-20T10:03:19.000Z | 2022-03-22T11:17:10.000Z | test/browser/window/controller/remove_handle_by_id_test.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | null | null | null | test/browser/window/controller/remove_handle_by_id_test.py | jakob-bagterp/browserist | 76bd916dd217b7da3759fd6ec3374191002dc091 | [
"Apache-2.0"
] | null | null | null | from contextlib import nullcontext as does_not_raise
from typing import Any
import pytest
from _mock_data.window_handles import WINDOW_HANDLE_1_ID, WINDOW_HANDLE_4_ID
from browserist.exception.window_handle import WindowHandleIdNotFoundError, WindowHandleIdNotValidError
from browserist.model.window.controller import ... | 41.611111 | 155 | 0.814419 | from contextlib import nullcontext as does_not_raise
from typing import Any
import pytest
from _mock_data.window_handles import WINDOW_HANDLE_1_ID, WINDOW_HANDLE_4_ID
from browserist.exception.window_handle import WindowHandleIdNotFoundError, WindowHandleIdNotValidError
from browserist.model.window.controller import ... | true | true |
790dd8b5cd7edaafbdebd0957f76e3486a2f9a9e | 6,153 | py | Python | applications/javelin/models/menu.py | jjacobson93/javelin-web2py | d4de493156c6893acca74d4be7f4597c90c418f3 | [
"BSD-3-Clause"
] | null | null | null | applications/javelin/models/menu.py | jjacobson93/javelin-web2py | d4de493156c6893acca74d4be7f4597c90c418f3 | [
"BSD-3-Clause"
] | null | null | null | applications/javelin/models/menu.py | jjacobson93/javelin-web2py | d4de493156c6893acca74d4be7f4597c90c418f3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
response.logo... | 44.266187 | 79 | 0.478628 | true | true | |
790dd98e40c32e5ef94d00d466dc9334c2cc8fca | 376 | py | Python | noncookingjob.py | vmlane/jobMatcher | f5929134e6e14786ca9f71cc0329f0fed59b35da | [
"MIT"
] | null | null | null | noncookingjob.py | vmlane/jobMatcher | f5929134e6e14786ca9f71cc0329f0fed59b35da | [
"MIT"
] | null | null | null | noncookingjob.py | vmlane/jobMatcher | f5929134e6e14786ca9f71cc0329f0fed59b35da | [
"MIT"
] | null | null | null | from job import *
class NoncookingJob(Job):
def __init__(self, name, prefs, maxMatches):
Job.__init__(self, name, prefs, maxMatches)
# remove pairs & underclassmen
self.prefs = filter(lambda x: x.numPeople != 1 and x.semsCooked < 4, self.prefs)
# sort all the people by number of semesters cooked, high to low... | 37.6 | 83 | 0.728723 | from job import *
class NoncookingJob(Job):
def __init__(self, name, prefs, maxMatches):
Job.__init__(self, name, prefs, maxMatches)
self.prefs = filter(lambda x: x.numPeople != 1 and x.semsCooked < 4, self.prefs)
prefs.sort(key=lambda x: x.semsCooked, reverse=True)
| true | true |
790ddbcd7888dfff9258436b8a98ccebabef1cd9 | 4,941 | py | Python | torch/distributed/algorithms/model_averaging/averagers.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 1 | 2022-01-20T03:49:23.000Z | 2022-01-20T03:49:23.000Z | torch/distributed/algorithms/model_averaging/averagers.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 14 | 2021-10-14T06:58:50.000Z | 2021-12-17T11:51:07.000Z | torch/distributed/algorithms/model_averaging/averagers.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | null | null | null | import warnings
from abc import ABC, abstractmethod
import torch.distributed as dist
import torch.distributed.algorithms.model_averaging.utils as utils
class ModelAverager(ABC):
r"""Base class for all model averagers.
Args:
process_group: The process group to be used for all-reduce.
... | 42.230769 | 116 | 0.612224 | import warnings
from abc import ABC, abstractmethod
import torch.distributed as dist
import torch.distributed.algorithms.model_averaging.utils as utils
class ModelAverager(ABC):
def __init__(self, process_group=None):
self.process_group = (
process_group if process_group is not None else dis... | true | true |
790ddc222efaf49cc540383db964dfb094041101 | 1,097 | py | Python | Day 18/Queue and stacks.py | SayanBan/HackerRank-30-Days-of-code | c2fea8304d7c9af13748fcce57c07a7ca180eda4 | [
"MIT"
] | 2 | 2019-11-20T04:45:27.000Z | 2019-12-07T04:31:47.000Z | Day 18/Queue and stacks.py | SayanBan/HackerRank-30-Days-of-code | c2fea8304d7c9af13748fcce57c07a7ca180eda4 | [
"MIT"
] | null | null | null | Day 18/Queue and stacks.py | SayanBan/HackerRank-30-Days-of-code | c2fea8304d7c9af13748fcce57c07a7ca180eda4 | [
"MIT"
] | 1 | 2019-12-07T04:31:59.000Z | 2019-12-07T04:31:59.000Z | import sys
class Solution:
# Write your code here
def __init__(self):
self.stack = []
self.queue = []
def popCharacter(self):
return self.stack.pop()
def pushCharacter(self, char):
self.stack.append(char)
def dequeueCharacter(self):
char = self.queue[0]
... | 22.854167 | 54 | 0.646308 | import sys
class Solution:
def __init__(self):
self.stack = []
self.queue = []
def popCharacter(self):
return self.stack.pop()
def pushCharacter(self, char):
self.stack.append(char)
def dequeueCharacter(self):
char = self.queue[0]
self.queue = sel... | true | true |
790ddc9a7829e5f42dca0f59b4903dfd9d2f3621 | 4,564 | py | Python | locallibrary/settings.py | TheRedemp7ion/DjangoLocalLibrary | e3c49da272d863185681b2b934c45a4693054a7a | [
"Unlicense"
] | null | null | null | locallibrary/settings.py | TheRedemp7ion/DjangoLocalLibrary | e3c49da272d863185681b2b934c45a4693054a7a | [
"Unlicense"
] | null | null | null | locallibrary/settings.py | TheRedemp7ion/DjangoLocalLibrary | e3c49da272d863185681b2b934c45a4693054a7a | [
"Unlicense"
] | null | null | null | """
Django settings for locallibrary project.
Generated by 'django-admin startproject' using Django 3.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pa... | 29.070064 | 103 | 0.724803 |
from pathlib import Path
import pytz
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-@*cqyd6l)4*=yg7r19zmp#y32mpus(a2d-)ny&hstt^kq!13jk'
import os
DEBUG = True
ALLOWED_HOSTS = ['obscure-plateau-04602.herokuapp.com']
# Application definition
INSTALLED_APPS = [
... | true | true |
790ddcb0947ec5c383af11aaf8bdbcf8ab880246 | 60,361 | bzl | Python | third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl | suever/grpc | 0bee8c41f9c52f81a06fbd8444b2d53249c484a9 | [
"Apache-2.0"
] | 2 | 2019-05-26T05:00:55.000Z | 2019-06-15T10:18:57.000Z | third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl | suever/grpc | 0bee8c41f9c52f81a06fbd8444b2d53249c484a9 | [
"Apache-2.0"
] | 2 | 2017-03-07T22:54:36.000Z | 2017-04-14T15:17:36.000Z | third_party/toolchains/bazel_0.23.2_rbe_windows/cc_toolchain_config.bzl | suever/grpc | 0bee8c41f9c52f81a06fbd8444b2d53249c484a9 | [
"Apache-2.0"
] | 4 | 2020-08-10T06:05:01.000Z | 2021-12-12T09:26:50.000Z | # Copyright 2019 The Bazel 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 applicable la... | 35.402346 | 384 | 0.519259 |
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"artifact_name_pattern",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"variable_with_value",
"with_fea... | true | true |
790ddea0a7befd113cbee96ab0c5dd2da399d1ad | 8,729 | py | Python | mri_convert_ppc64/mri_convert_ppc64.py | quinnyyy/pl-mri_convert_ppc64 | 8a3e1bd5778c350432467ad19f2262809ee2833c | [
"MIT"
] | 1 | 2021-04-22T10:48:36.000Z | 2021-04-22T10:48:36.000Z | mri_convert_ppc64/mri_convert_ppc64.py | quinnyyy/pl-mri_convert_ppc64 | 8a3e1bd5778c350432467ad19f2262809ee2833c | [
"MIT"
] | null | null | null | mri_convert_ppc64/mri_convert_ppc64.py | quinnyyy/pl-mri_convert_ppc64 | 8a3e1bd5778c350432467ad19f2262809ee2833c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# mri_convert_ppc64 ds ChRIS plugin app
#
# (c) 2016-2019 Fetal-Neonatal Neuroimaging & Developmental Science Center
# Boston Children's Hospital
#
# http://childrenshospital.org/FNNDSC/
# dev@babyM... | 39.677273 | 108 | 0.414251 |
#
# http://childrenshospital.org/FNNDSC/
# dev@babyMRI.org
#
import os
import sys
sys.path.append(os.path.dirname(__file__))
# import the Chris app superclass
from chrisapp.base import ChrisApp
Gstr_title = """
_ _ ... | true | true |
790ddf0a84ca9a769e99f0de79a3d0d263813d02 | 1,100 | py | Python | python/ecs/cluster/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 2,941 | 2019-02-08T15:29:36.000Z | 2022-03-31T23:57:42.000Z | python/ecs/cluster/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 558 | 2019-02-14T23:32:02.000Z | 2022-03-30T00:35:11.000Z | python/ecs/cluster/app.py | marclyo/aws-cdk-examples | f041f07ebd4c94897e16d37ff813a38eb32645a1 | [
"Apache-2.0"
] | 1,409 | 2019-02-12T19:13:04.000Z | 2022-03-31T18:46:21.000Z | from aws_cdk import (
aws_autoscaling as autoscaling,
aws_ec2 as ec2,
aws_ecs as ecs,
core,
)
class ECSCluster(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, *kwargs)
vpc = ec2.Vpc(
self, "MyVpc",
... | 26.190476 | 73 | 0.583636 | from aws_cdk import (
aws_autoscaling as autoscaling,
aws_ec2 as ec2,
aws_ecs as ecs,
core,
)
class ECSCluster(core.Stack):
def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, *kwargs)
vpc = ec2.Vpc(
self, "MyVpc",
... | true | true |
790ddf55f9a0fae73beca060e792297299998965 | 1,165 | py | Python | XD/mysite/polls/migrations/0001_initial.py | ChyiLin/HAHA | d0492b7dee2881d35c000659c44099dad8b41083 | [
"MIT"
] | null | null | null | XD/mysite/polls/migrations/0001_initial.py | ChyiLin/HAHA | d0492b7dee2881d35c000659c44099dad8b41083 | [
"MIT"
] | null | null | null | XD/mysite/polls/migrations/0001_initial.py | ChyiLin/HAHA | d0492b7dee2881d35c000659c44099dad8b41083 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2018-12-22 04:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | 31.486486 | 114 | 0.577682 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(auto_created=Tr... | true | true |
790ddf7082426bbcac3a19c111985878009197dc | 3,413 | py | Python | Tools/Scripts/webkitpy/tool/mocktool.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 6 | 2021-07-05T16:09:39.000Z | 2022-03-06T22:44:42.000Z | Tools/Scripts/webkitpy/tool/mocktool.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | 7 | 2022-03-15T13:25:39.000Z | 2022-03-15T13:25:44.000Z | Tools/Scripts/webkitpy/tool/mocktool.py | jacadcaps/webkitty | 9aebd2081349f9a7b5d168673c6f676a1450a66d | [
"BSD-2-Clause"
] | null | null | null | # Copyright (C) 2011 Google Inc. All rights reserved.
# Copyright (C) 2019 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above ... | 39.229885 | 113 | 0.730735 |
import threading
from webkitpy.common.host_mock import MockHost
from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot
from webkitpy.common.net.ewsserver_mock import MockEWSServer
from webkitpy.common.net.irc.irc_mock import MockIRC
from webkitpy.common.config.ports_mock imp... | true | true |
790ddf754117b4c22fe3e2bc8015b1a7f07d3419 | 1,107 | py | Python | pypy/rlib/rsdl/test/test_basic.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/rlib/rsdl/test/test_basic.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/rlib/rsdl/test/test_basic.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | import py
from pypy.rlib.rsdl import RSDL
from pypy.rlib.rarithmetic import r_uint
from pypy.rpython.lltypesystem import rffi
def test_sdl_init():
assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
RSDL.Quit()
def test_surface_basic():
assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
surface = RSDL.CreateRGBSurface(0, 150... | 29.918919 | 55 | 0.591689 | import py
from pypy.rlib.rsdl import RSDL
from pypy.rlib.rarithmetic import r_uint
from pypy.rpython.lltypesystem import rffi
def test_sdl_init():
assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
RSDL.Quit()
def test_surface_basic():
assert RSDL.Init(RSDL.INIT_VIDEO) >= 0
surface = RSDL.CreateRGBSurface(0, 150... | true | true |
790ddfee99fe92fd2db69b46c73d0d1385a07ab0 | 3,219 | py | Python | build/lib/crowdkit/aggregation/base/__init__.py | artinmajdi/crowd-kit | 174e15f256a4929ed71699ffc1797ea87e0e8a99 | [
"Apache-2.0"
] | null | null | null | build/lib/crowdkit/aggregation/base/__init__.py | artinmajdi/crowd-kit | 174e15f256a4929ed71699ffc1797ea87e0e8a99 | [
"Apache-2.0"
] | null | null | null | build/lib/crowdkit/aggregation/base/__init__.py | artinmajdi/crowd-kit | 174e15f256a4929ed71699ffc1797ea87e0e8a99 | [
"Apache-2.0"
] | 1 | 2021-12-24T02:26:57.000Z | 2021-12-24T02:26:57.000Z | __all__ = [
'BaseClassificationAggregator',
'BaseImageSegmentationAggregator',
'BaseEmbeddingsAggregator',
'BaseTextsAggregator',
'BasePairwiseAggregator',
]
import attr
from .. import annotations
@attr.s
@annotations.manage_docstring
class BaseClassificationAggregator:
""" This is a base cla... | 34.612903 | 124 | 0.724138 | __all__ = [
'BaseClassificationAggregator',
'BaseImageSegmentationAggregator',
'BaseEmbeddingsAggregator',
'BaseTextsAggregator',
'BasePairwiseAggregator',
]
import attr
from .. import annotations
@attr.s
@annotations.manage_docstring
class BaseClassificationAggregator:
labels_: annotations.... | true | true |
790de0b9bf41aabb534f397b8543e51a0f9d7132 | 7,299 | py | Python | python/pyspark/taskcontext.py | zhouyuan/sparkV | 688e2a5850c66084d592855b4ca345baeaeabee3 | [
"Apache-2.0"
] | 6 | 2020-06-28T08:23:22.000Z | 2021-12-25T07:25:32.000Z | python/pyspark/taskcontext.py | zhouyuan/sparkV | 688e2a5850c66084d592855b4ca345baeaeabee3 | [
"Apache-2.0"
] | 4 | 2019-11-14T13:25:17.000Z | 2021-01-21T00:08:25.000Z | python/pyspark/taskcontext.py | zhouyuan/sparkV | 688e2a5850c66084d592855b4ca345baeaeabee3 | [
"Apache-2.0"
] | 4 | 2020-06-28T08:23:33.000Z | 2021-08-04T07:24:45.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 31.873362 | 98 | 0.65735 |
from __future__ import print_function
from pyspark.java_gateway import local_connect_and_auth
from pyspark.serializers import write_int, UTF8Deserializer
class TaskContext(object):
_taskContext = None
_attemptNumber = None
_partitionId = None
_stageId = None
_taskAttemptId = N... | true | true |
790de0d7084706fafc0cf001bb4f424782073242 | 4,045 | py | Python | userbot/plugins/fconvert.py | anandhu-dev/catuserbot | 0ae10db978c1a9bf3f4f0da991a86d85fc29c0f1 | [
"MIT"
] | null | null | null | userbot/plugins/fconvert.py | anandhu-dev/catuserbot | 0ae10db978c1a9bf3f4f0da991a86d85fc29c0f1 | [
"MIT"
] | null | null | null | userbot/plugins/fconvert.py | anandhu-dev/catuserbot | 0ae10db978c1a9bf3f4f0da991a86d85fc29c0f1 | [
"MIT"
] | null | null | null | """File Converter
.nfc """
import asyncio
import os
import time
from datetime import datetime
from userbot.utils import admin_cmd, progress
@borg.on(admin_cmd(pattern="nfc (.*)")) # pylint:disable=E0602
async def _(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
reply_... | 37.110092 | 103 | 0.5644 |
import asyncio
import os
import time
from datetime import datetime
from userbot.utils import admin_cmd, progress
@borg.on(admin_cmd(pattern="nfc (.*)"))
async def _(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
reply_message = await event.get_reply_message()
if ... | true | true |
790de0eafb238d094bd686b29f075e37c87c9f95 | 3,638 | py | Python | tests/test_buffer.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 10 | 2017-04-10T18:25:41.000Z | 2021-09-15T20:14:58.000Z | tests/test_buffer.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 9 | 2020-04-04T09:49:52.000Z | 2020-04-21T01:52:02.000Z | tests/test_buffer.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 12 | 2022-01-30T23:34:18.000Z | 2022-03-26T17:09:43.000Z | import unittest
from streamlink.buffers import Buffer, RingBuffer
class TestBuffer(unittest.TestCase):
def setUp(self):
self.buffer = Buffer()
def test_write(self):
self.buffer.write(b"1" * 8192)
self.buffer.write(b"2" * 4096)
self.assertEqual(self.buffer.length, 8192 + 4096... | 33.072727 | 71 | 0.628642 | import unittest
from streamlink.buffers import Buffer, RingBuffer
class TestBuffer(unittest.TestCase):
def setUp(self):
self.buffer = Buffer()
def test_write(self):
self.buffer.write(b"1" * 8192)
self.buffer.write(b"2" * 4096)
self.assertEqual(self.buffer.length, 8192 + 4096... | true | true |
790de139870f747ae341b9866271e007ce38a944 | 3,093 | py | Python | dakara_server/users/tests/test_backends.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 4 | 2018-07-24T18:22:16.000Z | 2020-01-24T16:30:54.000Z | dakara_server/users/tests/test_backends.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 88 | 2017-11-04T08:58:02.000Z | 2022-03-30T11:39:08.000Z | dakara_server/users/tests/test_backends.py | DakaraProject/dakara-server | b28fc1a8561e431d562102932f3d6ff3607e545b | [
"MIT"
] | 1 | 2018-05-05T15:37:20.000Z | 2018-05-05T15:37:20.000Z | from unittest.mock import MagicMock
from django.core.exceptions import ValidationError
from users.backends import DakaraModelBackend
from users.tests.base_test import UsersAPITestCase, config_email_disabled
class DakaraModelBackendTestCase(UsersAPITestCase):
"""Test the authentication backend."""
def setUp... | 35.551724 | 88 | 0.66602 | from unittest.mock import MagicMock
from django.core.exceptions import ValidationError
from users.backends import DakaraModelBackend
from users.tests.base_test import UsersAPITestCase, config_email_disabled
class DakaraModelBackendTestCase(UsersAPITestCase):
def setUp(self):
self.user = self.c... | true | true |
790de37a120d52978b54761134121afb95f0f831 | 7,659 | py | Python | yassd/testing_utils/videotest.py | hanhejia/SSD | 0c5684ad786768b46b119fb503f4f7174e2c78ed | [
"MIT"
] | null | null | null | yassd/testing_utils/videotest.py | hanhejia/SSD | 0c5684ad786768b46b119fb503f4f7174e2c78ed | [
"MIT"
] | null | null | null | yassd/testing_utils/videotest.py | hanhejia/SSD | 0c5684ad786768b46b119fb503f4f7174e2c78ed | [
"MIT"
] | null | null | null | """ A class for testing a SSD model on a video file or webcam """
import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import pickle
import numpy as np
from r... | 41.625 | 100 | 0.536362 |
import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import pickle
import numpy as np
from random import shuffle
from scipy.misc import imread, imresize
from ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.